Let's say I have a function with a signature like this: private function (date:Date) { trace(date.datetime); } ... when I send a date value into this function does the time portion gets converted into local time automatically? Thanks
I think you are describing a classic date management problem that has no single good solution. The problem is that if you store dates in local time and don’t store timezone information, you don’t have enough data to view the date as desired on other clients especially if they are in other time zones. You will find other past discussions on this topic.
The basic problem is that, if you have, say, a west coast office and an east coast office and the west coast office records a transaction at 9am and stores it as 9am, the east coast office doesn’t know whether it happened at 9am their time or 12pm their time. There is another version of the problem where things are stored in GMT but you really want to reproduce the local time display at the office that made the transaction.
One solution offered is to not use date/time and simply use a string. Otherwise, you have to know which office made the transaction and what time zone it is in.
Oh yeah, that’s another variant of the problem. You want to display a time based on a certain time zone regardless of the time zone of the user. I think folks store UTC and then convert to the desired timezone in the view controls. You can also convert to the desired timezone before converting to string. Fundamentally you have to know the user’s time zone and the “standard” timezone.
North America
Europe, Middle East and Africa
Asia Pacific