[Solved] Timestamp conversion
-
- Posts: 4
- Joined: Wed Dec 19, 2007 8:54 pm
[Solved] Timestamp conversion
Does anyone have a macro that will convert a long list of unix epoch timestamps to dates? If there were a macro to do this, I would be very grateful; at the moment I am cutting and pasting them into the date -d function in a command prompt or doing it online, which is very very slow.
Last edited by Hagar Delest on Tue Jun 10, 2008 3:57 pm, edited 2 times in total.
Reason: tagged the thread as solved.
Reason: tagged the thread as solved.
Re: timestamp conversion
It would be a lot simpler to make a suggestion if you gave a couple of samples.
AOO4/LO5 • Linux • Fedora 23
-
- Posts: 4
- Joined: Wed Dec 19, 2007 8:54 pm
Re: timestamp conversion
I have the data as a text file, with 589 entries as a column at the moment, though I can manipulate it easily into comma or other 'symbol-delimited' file (though I can't find a way to replace with tabs in OO.....).
The data look like
1197048832
1197048833
1197050634
1197050635
1197053082
1197053083
1197053802
1197053803
1197054072
1197054073
1197054747
1197054748
1197055242
1197055243
1197055497
1197055498
and they are linux timestamps, in seconds, counting from t=0 as 1st Jan 1970. I'd like to convert them to day:month:year:hour:min:sec if possible, and I want to avoid doing this entry by entry - I could do this already but I am lazy and don't have time.
I have tried the extension 'DateTime2' but it appears not to handle multiple entries.
John
The data look like
1197048832
1197048833
1197050634
1197050635
1197053082
1197053083
1197053802
1197053803
1197054072
1197054073
1197054747
1197054748
1197055242
1197055243
1197055497
1197055498
and they are linux timestamps, in seconds, counting from t=0 as 1st Jan 1970. I'd like to convert them to day:month:year:hour:min:sec if possible, and I want to avoid doing this entry by entry - I could do this already but I am lazy and don't have time.
I have tried the extension 'DateTime2' but it appears not to handle multiple entries.
John
Re: timestamp conversion
As you are posting in 'Calc' - you may like a formular, see:
Convert UNIX timestamp
Will give you the Calc date value, then format to your needs (Format>Cells).
Pls state OOo version and OS you are using in case of any error.
The extension does not convert dates... so it doesn't solve your question. The posting linked above should help you.
Convert UNIX timestamp
Will give you the Calc date value, then format to your needs (Format>Cells).
Sorry, please explain: you should be able to insert into a single cell, a range of cells, into multiple ranges.I have tried the extension 'DateTime2' but it appears not to handle multiple entries.
Pls state OOo version and OS you are using in case of any error.
The extension does not convert dates... so it doesn't solve your question. The posting linked above should help you.
-
- Posts: 4
- Joined: Wed Dec 19, 2007 8:54 pm
Re: timestamp conversion
Hi Winfried,
I can convert a single cell to give me the correct human date and time but when I try to apply the extension to the whole column, it repeats year-month-day for the whole lot as per the first cell.
My 'end-around' came from the web at http://www.epochconverter.com/epoch/batch-convert.php which converted the lot into an html table, which I cut and pasted into an OO document (.odt, using OO 2.3.1 on fedora 7) and I will be able to get that to a spreadsheet in a few clicks, so the problem is solved functionally, albeit externally to OO.......
John
I can convert a single cell to give me the correct human date and time but when I try to apply the extension to the whole column, it repeats year-month-day for the whole lot as per the first cell.
My 'end-around' came from the web at http://www.epochconverter.com/epoch/batch-convert.php which converted the lot into an html table, which I cut and pasted into an OO document (.odt, using OO 2.3.1 on fedora 7) and I will be able to get that to a spreadsheet in a few clicks, so the problem is solved functionally, albeit externally to OO.......
John
Re: timestamp conversion
If you want to do it in Calc in futureworks with a timestamp in A1 and the formula cell formatted DD/MM/YYYY HH:MM:SS
Then just drag-fill down.
Code: Select all
=A1/86400+DATEVALUE("1/1/1970")
Then just drag-fill down.
-
- Posts: 4
- Joined: Wed Dec 19, 2007 8:54 pm
[SOLVED]Re: timestamp conversion
That is a great deal easier and I will use it next time I have to do this
John
John