- October 27, 2023 at 11:56 pm #29524Eric PementParticipant
Is there a function, macro, feature, or method in EmEditor to convert epoch seconds (in Unix, the number of seconds since the beginning of the epoch, defined as January 1, 1970 UTC) to human-readable date and time as ISO format (YYYY-MM-DD HH:MM:SS) ?
I had some CSV data to handle with usernames, IP addresses, and timestamps as epoch seconds, and I wanted to convert that column to human-readable format.
I couldn’t see how to do it in EmEditor, so in the end I used sed and then awk.
Thanks for any suggestions.October 28, 2023 at 4:03 am #29525DavidParticipant
Please try by using Find & Replace function:
Replace: \J new Date(‘\0’)October 28, 2023 at 11:07 am #29526Eric PementParticipant
David, thanks for the suggestion, but it inserts the string “Invalid Date” into the replacement field.
I am using the Replace command (Ctrl+H), or “Search > Replace” from the menubar on top, with “Wrap Around” checked and “Regular Expressions” chosen in the radio buttons
The solution worked when I changed the replace portion to: \J new Date(“\0” * 1000)October 28, 2023 at 7:54 pm #29527DavidParticipant
Thanks for sharing experience.
- You must be logged in to reply to this topic.