my version is:

SimpleDateFormat theDF = new SimpleDateFormat("yyyy-MM-DD H:m");
String dateString = new NSTimestamp().toString();
dateString = dateString.substring(0, 10);
dateString = dateString + " " + "9:00" + " Etc/GMT";
        
Date thedate = null;
try {
        thedate = theDF.parse(dateString);
} catch (ParseException e) {
        // TODO Auto-generated catch block
                e.printStackTrace();
}
                
setMeetingTime(new NSTimestamp(thedate));

I was just starting to examine something like what you did. 

thanks for the second pair of eyes.

Ted

--- On Thu, 1/17/13, [email protected] <[email protected]> wrote:

> From: [email protected] <[email protected]>
> Subject: Re: best way to create date/time
> To: "Theodore Petrosky" <[email protected]>
> Cc: "WebObjects Development" <[email protected]>
> Date: Thursday, January 17, 2013, 9:57 AM
> How about:
> 
> GregorianCalendar myCalendar = new GregorianCalendar();
> myCalendar.setTime(new NSTimestamp());
> int currentYear = myCalendar.get(GregorianCalendar.YEAR);
> int currentMonth = myCalendar.get(GregorianCalendar.MONTH);
> int currentDay = myCalendar.get(GregorianCalendar.DAY);
> TimeZone timeZone = TimeZone.getDefault(); // should get the
> time zone for the host 
> NSTimestamp timestamp = new NSTimestamp(currentYear,
> currentMonth, currentDay, 9, 0, 0, timeZone);
> 
> Steve
> 
> On Jan 17, 2013, at 9:48 AM, Theodore Petrosky <[email protected]>
> 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 protected])
> > Help/Unsubscribe/Update your Subscription:
> > https://lists.apple.com/mailman/options/webobjects-dev/speery%40me.com
> > 
> > This email sent to [email protected]
> 
> 

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to