Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: NSDateFormatter question...



If you are looking for an NSDate object with a value of the current date and
time, then +[NSDate date] is there for you. :) 

-----Original Message-----
From: cocoa-dev-bounces+tophu=email@hidden
[mailto:cocoa-dev-bounces+tophu=email@hidden] On Behalf Of Alec
Carlson
Sent: Thursday, September 15, 2005 11:50 AM
To: email@hidden
Subject: Re: NSDateFormatter question...

Ricky,

You are right ­ I did miss the point. I assumed that ³today² meant both
today¹s date and today¹s time. However, if "today" is just the date and not
the time then the time value out of :dateFromString: is irrelevant. It would
be nice if there was a :timeFromString: method which would give you the
current date & time from "Today"... Thanks for your help -

Alec

on 9/15/05 10:01 AM, Ricky Sharp at email@hidden wrote:

>  
> On Thursday, September 15, 2005, at 09:06AM, Alec Carlson
> <email@hidden> wrote:
> 
>> The problem is that I have an NSDateFormatter connected to an NSTextEdit
>> field in a GUI. The date/time the user enters is used to determine what
>> database records I display. If the user enters ?Today?  I expect that :
>> dateFromString: would return either the current date/time as the best
result
>> for the natural language translation of ?today? or 11:59:59 PM as the
whole
>> time range of today. If I have to parse the text field myself in order to
>> know the user entered ?today? then what?s the point of the translation ?
As
>> it is, if the user enters ?today? and it?s 5:00 PM then they only see
>> records before 12:00 noon and nothing from noon to 5:00 PM. ?Today?
doesn?t
>> end at noon ? well maybe in some parts of the world it does, and in
>> Cupertino, but not in Texas :)
> 
> You missed my point.  "today" is just an alternate form to specify a date
(and
> not a particular time).  It makes sense the the time data is filled in
with
> the midpoint of the day.  As John pointed out in another reply to this
thread,
> you may want to consider adding a time field to allow users to enter in
> specific times.
> 
> What exactly can the user enter in your existing text field?  I'll assume
they
> can enter both a date and time.  If the user enters both, you're done.  If
> they only enter in the date (to include using 'symbolic' names like
"today"),
> then it will be up to you to provide the appropriate time data.  Depending
> upon the queries you're doing, I could see where sometimes you'd want the
> first second of the day; other times the last second.
> 
> --
> Rick Sharp
> Instant Interactive(tm)
> 
>   
> 


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

References: 
 >Re: NSDateFormatter question... (From: Alec Carlson <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.