A real problem - Date to Timestamp - help -
None1337 - 26.12.2018
So, i have a last login on a player saved like this:
2018-12-26 19:42:18
How can I get the exact timestamp on this date?
I have already timestampdate.inc but the format should be like: 26.12.2018 (probably in your country: 12.26.2018 ), and i can't specify the hours, minutes and seconds.
Does anybody know a function that i convert the date above (2018-12-26 19:42:18 ) to unixtime?
I really need this.
Thanks!
Re: A real problem - Date to Timestamp - help -
N3mesiS - 26.12.2018
Perhaps, getdate and gettime?
PHP код:
new d, m, y; getdate(y, m, d);
new h, mn, s; gettime(h, mn, s);
Re: A real problem - Date to Timestamp - help -
None1337 - 26.12.2018
No, I already have the date:
2018-12-26 19:42:18 but I want to be in timestamp,
like: 1545846977 (2018-12-26T17:56:17+00:00) - source: wikipedia.
Re: A real problem - Date to Timestamp - help -
NaS - 26.12.2018
So you technically only need to extract the day, month, year and hour, minute and second to pass it to a function from the include, right? There should be DateToTimestamp which takes the date as seperate values.
You could use sscanf for it, if the format is always going to be the same.
PHP код:
new day, month, year, hour, minute, second;
sscanf(date_string, "p<-:>iiiiii", year, month, day, hour, minute, second);
Re: A real problem - Date to Timestamp - help -
aKnoxx - 26.12.2018
PHP код:
new Timestamp = gettime(Hour, Minute, Second);
This?
Outputs like this: 1545848117