• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: H2 and timezones
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: H2 and timezones


  • Subject: Re: H2 and timezones
  • From: Chuck Hill <email@hidden>
  • Date: Mon, 07 Mar 2011 12:03:27 -0800

I think the intended replacement is SimpleDateFormat.  I recall that Mike had a subclass that understood NSTimestampFormatter symbols.  I thought that went in Wonder, but I don't see it.


Chuck



On Mar 7, 2011, at 11:43 AM, John Huss wrote:

My recollection was that this was deprecated without any real alternative being available.  It's part of the magic that is WO 5.4.

John

On Mon, Mar 7, 2011 at 1:39 PM, George Domurot <email@hidden> wrote:
You can use the good 'ole NSTimestampFormatter, while it is deprecated and there is probably a Java version that you should use, it works:

       timestampFormatter = new NSTimestampFormatter( --add your format symbols-- );
       timestampFormatter.setDefaultFormatTimeZone( --add your timezone-- );
       timestampFormatter.setDefaultParseTimeZone( --add your timezone-- );

Then bind this to your WOTextFiend.dateformat attribute.

Maybe someone can comment on a non depreciated approach?

-G


On Mar 7, 2011, at 11:21 AM, Pascal Robert wrote:

> Just tried that, and when I display the date in a WOTextField with a dateformat formatter, the time show up in GMT instead of America/Montreal, even if I call this.setTimeZone(TimeZone.getTimeZone("America/Montreal")); in Session.java.
>
> To make it short, I want to store the time in GMT, but want to show and edit it in the local timezone of the user. Me starting to think that I should use a long that store the epoch :-/
>
>> any reason you can't just run your app in GMT via the user.timezone property?
>>
>> ms
>>
>> On Mar 7, 2011, at 9:10 AM, Pascal Robert wrote:
>>
>>> It look like H2 stores the time in the system's timezone instead of GMT. For example, a NSTimestamp which time is 13:40:58 Etc/GMT is stored as 08:40:58 because my system is set to America/Montreal (GMT -5). According to H2 documentation:
>>>
>>> " If the time zone is not set, the value is parsed using the current time zone setting of the system. Date and time information is stored in H2 database files without time zone information. If the database is opened using another system time zone, the date and time will be the same. That means if you store the value '2000-01-01 12:00:00' in one time zone, then close the database and open the database again in a different time zone, you will also get '2000-01-01 12:00:00'. Please note that changing the time zone after the H2 driver is loaded is not supported. "
>>>
>>> I really need to store the dates in GMT, or at least store the timezone offset, but I didn't find how to tell H2 to store it. I was thinking it might be because the formatter that ERH2PlugIn.formatValueForAttribute() calls is not storing the timezone offset, but when debugging, I don't even reach that formatter, so the problem doesn't seem to be there.
>>>
>>> --
>>> Pascal Robert
>>> email@hidden
>>>
>>> AIM/iChat : MacTICanada
>>> LinkedIn : http://www.linkedin.com/in/macti
>>> Twitter : pascal_robert
>>>
>>> _______________________________________________
>>> Do not post admin requests to the list. They will be ignored.
>>> Webobjects-dev mailing list      (email@hidden)
>>> Help/Unsubscribe/Update your Subscription:
>>>
>>> This email sent to email@hidden
>>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

-- 
Chuck Hill             Senior Consultant / VP Development

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.    
http://www.global-village.net/products/practical_webobjects







Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: H2 and timezones
      • From: Mike Schrag <email@hidden>
References: 
 >H2 and timezones (From: Pascal Robert <email@hidden>)
 >Re: H2 and timezones (From: Mike Schrag <email@hidden>)
 >Re: H2 and timezones (From: Pascal Robert <email@hidden>)
 >Re: H2 and timezones (From: George Domurot <email@hidden>)
 >Re: H2 and timezones (From: John Huss <email@hidden>)

  • Prev by Date: Re: D2W Question
  • Next by Date: Re: H2 and timezones
  • Previous by thread: Re: H2 and timezones
  • Next by thread: Re: H2 and timezones
  • Index(es):
    • Date
    • Thread