Hi guys, am I correct in my findings?
Date.Hours(TimeStamp) etc. all return an automatically localized return value?
My Question in a nutshell is how to localize a timestamp from a given value and not from the local machine
Here's the scenario:
I have a server feeding me a UTCTimeStamp and the server's regional settings separately.
I have to compare that to the terminals current time which i get from Date.UnixTimestamp (also not localized; obviously correct)
so I localize both and compare... (this is to be able to compare regardless of the local machines regional settings)
Here's the issue I have:
I have a localized timestamp that i want to extract Hours from
put it into Date.Hours and get out an hour that is now (localized + more localized)
my workaround is that i have to unlocalize the stamps again just to feed it through Date.Hours
If it is the case i have the following suggestion:
Date.Hours(Timestamp) returns hours of that timestamp only
Add:
Date.Localize(Timestamp,"regional") if regional is not given then it should use that machine's regional settings
example:
ServerTime: UTC +2 hours
ClientTime: UTC -2 hours
Localized from Server
var Timestamp = Date.UnixTimestamp();
var Region = "+0200";
var LocalizedTS = Date.Localize(Timestamp,Region);
console.log(Date.Hours(LocalizedTS));
//output: 14
[/code:y6eavdnu]
[b]Localized from Client[/b]
[code:y6eavdnu]
var Timestamp = Date.UnixTimestamp();
var LocalizedTS = Date.Localize(Timestamp);
console.log(Date.Hours(LocalizedTS));
//output: 10
[/code:y6eavdnu]