• 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: Displaying Local Time on a Web Client
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Displaying Local Time on a Web Client


  • Subject: Re: Displaying Local Time on a Web Client
  • From: Ray Kiddy <email@hidden>
  • Date: Tue, 31 Mar 2009 13:21:43 -0700


On Mar 31, 2009, at 9:20 AM, David Avendasora wrote:

Okay I know this must be easy, but I just can't seem to get it to work.

I just want to display the time a particular page was displayed.

My component has this:

CurrentTimestamp : WOString {
  value = currentTimestamp;
  dateformat ="%m/%d/%y %H:%M";
 }

When currentTimestamp returns a new NSTimestamp I get GMT, which is what I expected.

But when I return an NSTimestamp create like so:

GregorianCalendar calendar = new GregorianCalendar();
calendar.setTime(new NSTimestamp());
NSTimestamp timestamp = new NSTimestamp(calendar.getTimeInMillis(),
                        TimeZone.getTimeZone("America/Chicago"));
return timestamp;

I still get GMT.

What fundamental thing am I missing or doing wrong?

Dave


There are more ways to do things wrong, and it is harder to describe them, than the ways there are of doing it right. :-)

That being said, there should be a way to do this that is not deprecated, as NSTimestampFormatter is. O well. It works.

I have updated the TickTockMan application in Wonder to include a page from each time zone that includes such as the NSTimeZone object, the java.util.TimeZone object and a representation of the current time in the selected time zone.

My idea was that this app could be used to describe time stuff, to demonstrate code for it and to answer questions. But I have not been sitting around bored and have not done much with it.

If anyone has questions or suggestions, or if it makes something less clear rather than more clear, please give a holler.

cheers - ray

 _______________________________________________
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

References: 
 >Displaying Local Time on a Web Client (From: David Avendasora <email@hidden>)

  • Prev by Date: Re: Getters without the "get" part
  • Next by Date: Re: Getters without the "get" part
  • Previous by thread: Re: Displaying Local Time on a Web Client
  • Next by thread: Converting a project from WebObjects 5.3 to 5.4
  • Index(es):
    • Date
    • Thread