We have a search utility that needs to search by date:
So I type in a date "04-20-1982" in the search field. In the code:
Alert.show("string date::"+message.searchKeyword);
dateOfBirth = DateField.stringToDate(message.searchKeyword,"MM-DD-YYYY");
Alert.show("date::"+dateOfBirth);
The first alert prints as string date::04-20-1982
The second alert prints as date::Tue Apr 20 00:00:00 GMT-0400开发者_Python百科 1982
The issue is our timezone is EST and since it changes it as GMT -400, it takes the time as Mon Apr 19 23:00:00 EST 1982 and does not return any results. The actual DOB in the DB is Apr 20 1982.
So please let me know how to avoid this conversion to GMT -400 Timezone and just send it as a date without any timezone.
Thanks
Harish
Dates are transfered to/from Flex client as UTC date – no timezone information available. Transfer to the UTC/local time happens automatically on protocol level.
You can use something like this to get the offset and manually calculate the date:
var dNow:Date = new Date();
trace("Your time zone offset: " + dNow.getTimezoneOffset() + " minutes");
精彩评论