• 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: System time
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: System time


  • Subject: Re: System time
  • From: Jim Wong <email@hidden>
  • Date: Fri, 10 Mar 2006 00:46:53 +0800

Thanks all... got the datetime thingy to work already.

Warmest Regards,
Jim Wong
email@hidden



On Mar 9, 2006, at 10:16 AM, Jim Wong wrote:

apologies. i tried the GregorianCalendar actually but seem to keep getting the wrong date. okay... 

my code is as follows:
GregorianCalendar myCalendar=new GregorianCalendar();
String s=myCalendar.getTime().toString();
int year = myCalendar.get(GregorianCalendar.YEAR);
int month = myCalendar.get(GregorianCalendar.MONTH);
int date = myCalendar.get(GregorianCalendar.DATE);

System.out.println("Now: "+year+"-"+month+"-"+date);

the year and date is returns the correct value. But for month, it returns february instead of march. can anyone enlighten me on this?

Warmest Regards,
Jim Wong
email@hidden



On 09 Mar 2006, at 11:44 PM, Mark Morris wrote:

Is this actually a test to determine just how accommodating the readers of this list are?

Honestly, Jim, you'll get better a better response in the long term if you take some time to try and solve the easy ones yourself, either using the supplied documentation or searching the list archives.  If your project is under such a tight deadline that doing some research yourself is impossible, I know that there are people on this list who will (for a fee, of course) build a professional WebObjects application for you, and give you a good starting point for learning and upon which to base your future enhancements or applications.

In this particular case, you don't have to look past the very first constructor on the NSTimestamp reference page for the answer to your question.

Regards,
Mark

On Mar 9, 2006, at 9:32 AM, Jim Wong wrote:

How do I return the system time to be passed into a NSTimeStamp?


Warmest Regards,
Jim Wong
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: 
 >System time (From: Jim Wong <email@hidden>)
 >Re: System time (From: Mark Morris <email@hidden>)
 >Re: System time (From: Jim Wong <email@hidden>)
 >Re: System time (From: Mark Morris <email@hidden>)

  • Prev by Date: Re: System time
  • Next by Date: Re: Expanding Import
  • Previous by thread: Re: System time
  • Next by thread: Re: System time
  • Index(es):
    • Date
    • Thread