I have a string, which contains a timestamp (yyyy-mm-dd hh:mm:ss
). I can create a CultureInfo
object based on other information I get. Therefore I know which country the timestamp is in. The timestamp is not in UTC/GMT.
Say the timestamp is from Indonesia (new CultureInfo("id-ID")
) , meaning the string was created by code below or similar.
DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss");
That means the string contains the local time in Indonesia. I know my timezone, but I don't know how to convert the Indonesian time to UTC/GMT, so I can use the UTC/GMT object in TimeZoneInfo
. My own timezone may or may not be in the same timezone.
Is there anywhere, this information is connected?
CultureInfo
has a lot of properties, surely some of them can be used to get timezone, somwhere?
I might add that I find the entire system very confusing, so I could be way off in how I think things works.