Letraindusoir Posted March 28, 2019 Posted March 28, 2019 (edited) How can timestamps be converted into a common time format? Do have any available functions? 1522847958000 ==> 2018-03-28 【Unix / Linux】 date +%s -d"Jan 1, 1970 00:00:01" 【VBScript/ASP】 DateDiff("s", "01/01/1970 00:00:00", time) Edited March 29, 2019 by Letraindusoir
Developers Jos Posted March 28, 2019 Developers Posted March 28, 2019 Did you check the helpfile before asking here? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Letraindusoir Posted March 28, 2019 Author Posted March 28, 2019 51 minutes ago, Jos said: Did you check the helpfile before asking here? Jos I'm sorry, I'm a rookie, I'm not familiar with Autoit yet, I'll study it carefully, and hope you won't hesitate to give me a little guide suggestion.Many thanks!
Developers Jos Posted March 28, 2019 Developers Posted March 28, 2019 Sure thing .... Just post the tried code that isn't working when there are issues. Jos FrancescoDiMuro 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Nine Posted March 28, 2019 Posted March 28, 2019 Since you want to manipulate....dates, why not look into....dates management. Just an idea like that. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
Gianni Posted March 29, 2019 Posted March 29, 2019 Timestamps should be expressed in seconds elapsed since 01/01/1970 00:00:00 the timestamp number you presented seems to be espressed in milliseconds instead. If you have a look to the _DateAdd() function in the help, there is the exmple that you need. In short you have to add to the starting date of 01/01/1970 00:00:00 the number of seconds (not milliseconds) that you have, and you will have the target date, that is, the date you reach after all those seconds have elapsed since then. However, it seems that your timestamp (properly reduced to seconds) matches to 2018/04/04 and not 2018/03/28 as you indicated in OP #include <date.au3> Local $EpochSeconds = 1522847958 ; 000 MsgBox(0, '', _DateAdd('s', $EpochSeconds, "1970/01/01 00:00:00")) p.s. you can find some other formulas for conversions to / from other formats (also for AutoIt) at this link: https://www.epochconverter.com/ Letraindusoir 1 Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....
Letraindusoir Posted March 29, 2019 Author Posted March 29, 2019 11 hours ago, Chimp said: Timestamps should be expressed in seconds elapsed since 01/01/1970 00:00:00 the timestamp number you presented seems to be espressed in milliseconds instead. If you have a look to the _DateAdd() function in the help, there is the exmple that you need. In short you have to add to the starting date of 01/01/1970 00:00:00 the number of seconds (not milliseconds) that you have, and you will have the target date, that is, the date you reach after all those seconds have elapsed since then. However, it seems that your timestamp (properly reduced to seconds) matches to 2018/04/04 and not 2018/03/28 as you indicated in OP #include <date.au3> Local $EpochSeconds = 1522847958 ; 000 MsgBox(0, '', _DateAdd('s', $EpochSeconds, "1970/01/01 00:00:00")) p.s. you can find some other formulas for conversions to / from other formats (also for AutoIt) at this link: https://www.epochconverter.com/ That's OK!Thanks Chimp !Thanks again everyone for kind Help!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now