i need to replace all timestamps into a date but they're all in the same string and the output needs to be in the same string, i tried different methods but i can't get it working
The string format is like this one:
timestamp=1615676829306\sinvoker_database_id=1\sinvoker_nickname=serveradmin1\saction=query-join\sip=0.0.0.0\susername=serveradmin\sother_server=1\ssid=530|timestamp=1615676820366\sinvoker_database_id=32281\sinvoker_nickname=Electronic\sBot\saction=channel-edit\schannel_id=150\sproperty=channel_name\svalue_old=[cspacer]⠀⠀⠀█⠀▄⠀⠀⠀█⠀⠀▄⠀⠀█⠀⠀⠀█⠀█⠀⠀⠀█⠀\svalue_new=[cspacer]⠀⠀⠀█⠀▄⠀⠀⠀█⠀⠀▄⠀⠀█⠀⠀⠀█⠀⠀⠀▄▀⠀⠀|
The output should be like
timestamp=2021-03-13-22:04\sinvoker_database_id=1\sinvoker_nickname=serveradmin1\saction=query-join\sip=0.0.0.0\susername=serveradmin\sother_server=1\ssid=530|timestamp=2021-03-13-22:05\sinvoker_database_id=32281\sinvoker_nickname=Electronic\sBot\saction=channel-edit\schannel_id=150\sproperty=channel_name\svalue_old=[cspacer]⠀⠀⠀█⠀▄⠀⠀⠀█⠀⠀▄⠀⠀█⠀⠀⠀█⠀█⠀⠀⠀█⠀\svalue_new=[cspacer]⠀⠀⠀█⠀▄⠀⠀⠀█⠀⠀▄⠀⠀█⠀⠀⠀█⠀⠀⠀▄▀⠀⠀|
https://stackoverflow.com/questions/66620425/how-to-replace-all-timestamps-to-date-in-a-single-string-in-php March 14, 2021 at 10:06AM
没有评论:
发表评论