• 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: best way to create date/time
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: best way to create date/time


  • Subject: Re: best way to create date/time
  • From: Adalbert Winkler <email@hidden>
  • Date: Thu, 17 Jan 2013 16:15:42 +0100



Calendar cal = cal.getInstance(<your timezone>);
or
Calendar cal = cal.getInstance(); // default time zone

cal.set(Calendar.HOUR_OF_DAY, 9 );

NSTimestamp n = new NSTimestamp(cal.getTime());

Regards, Adalbert

On 17.01.13 15:48, Theodore Petrosky wrote:
What is the best way to create today's day at 9:00

new NSTimestamp() will give me today and the time is at the moment of creation. so the end result I want is (regardless of when in the day I create it):

new Timestamp(today at 9am);
2013-01-17 09:00 Etc/GMT

I am doing it rather convolutedly. Maybe there is a simple WO way.

Ted
  _______________________________________________
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

References: 
 >best way to create date/time (From: Theodore Petrosky <email@hidden>)

  • Prev by Date: Re: best way to create date/time
  • Next by Date: Re: [Announce] WOCommunity repository for CentOS/RedHat Linux
  • Previous by thread: Re: best way to create date/time
  • Next by thread: java.security.UnrecoverableKeyException on deployment.
  • Index(es):
    • Date
    • Thread