Hi guys,

I have a database with dates in CET and would like to preset them in the local 
time of the users.
It is a web app.

This is the only way I was able to convert between time zones, but that should 
be possible with DateFormatters too, right?

NSCalendarDate  * date = [NSDate date]; // just for testing
  
NSLog([[date dateWithCalendarFormat:@"%d.%m.%Y %H:%M:%S %z" 
                           timeZone:[NSTimeZone 
timeZoneWithName:@"Europe/Berlin"]] descriptionWithLocale:nil]);
  
NSLog([[date dateWithCalendarFormat:@"%d.%m.%Y %H:%M:%S %z"
                          timeZone:[NSTimeZone 
timeZoneWithName:@"America/Vancouver"]] descriptionWithLocale:nil]);

The output of the above is:

2009-11-19 06:59:10.084 NSTimeZoneTest[3027] 19.11.2009 06:59:09 +0100
2009-11-19 06:59:10.104 NSTimeZoneTest[3027] 18.11.2009 21:59:09 -0800

Cheers

David



_______________________________________________
Gnustep-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnustep-dev

Reply via email to