Hello, here’s my little code to get the timestamp by the year / month / day / hour / min / sec.
I’m using libc.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
Namespace myapp #Import "<std>" #Import "<libc>" Using std.. Using libc.. Function Main() Local seconds:time_t Local p:tm_t Ptr Local date:String libc.time(Varptr seconds) p = localtime(Varptr seconds) date = String(p->tm_sec) + "-" + String(p->tm_min) + "-" + String(p->tm_hour) + "-" + String(p->tm_mday) + "-" + String((p->tm_mon)+1) + "-" + String(1900 + p->tm_year) Print date End |
The output of mine was:
46-42-7-26-10-2018
Year: 2018
Month: 10
Day: 26
Hour: 7
Min: 42
Sec: 46
Hope many people will find this useful!