• 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: Strings and Timestamps
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strings and Timestamps


  • Subject: Re: Strings and Timestamps
  • From: Ray Ackland <email@hidden>
  • Date: Mon, 12 Jan 2004 17:26:25 +1300

Ari,

Sounds like you are wanting to format a string as a string - but in a different format! Don't expect there to be an easy way of doing this.

Some possibilities though:
1) Try to turn the current string into a date, and then change that date back into a string using a formatter
2) I would turn the attribute back into a NSTimestamp. For your fetch spec, you can create a qualifier with the current time stamp giving it a new NSTimestamp(). If you wanted to do the query on things that had today's date (ie ignoring the time part of it) you can set these parts to 0 using available methods - but don't ask me which ones, I just remember that there are some around not what they are :|


Ray.

On 12/01/2004, at 15:10, Y.A.Espinoza wrote:

I've got a datetime column in my database. In my model, I internally call it a String and leave it datetime externally. The reason I do this is because I use a fetch spec to call up today's event: Date = "current_date". I don't know that the datetime equivalent of that is, so by calling the column a string, I can get around it and the fetch spec works.

Anyway, I want dates to appear as "Monday, Jan 1, 2004" rather than "2004-01-01." I know I can use a formatter to do this, but that only seems to work with a column that is a datetime. Now, I've seen examples with a Timestamp to a String, but it seems that what I'm looking for is to display a String as a Timestamp.

Or, is there just an easier way to call up the current date in a fetch spec rather than resorting to all of this?
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Strings and Timestamps (From: "Y.A.Espinoza" <email@hidden>)

  • Prev by Date: Re: EOModeler and more
  • Next by Date: iCal Revisited
  • Previous by thread: Re: Strings and Timestamps
  • Next by thread: Re: Strings and Timestamps
  • Index(es):
    • Date
    • Thread