Board index » delphi » Please Help: Ignore Year when entering a date in TDateTime

Please Help: Ignore Year when entering a date in TDateTime

Hi!

How can help me with this, please (I guess it's another
newbie-problem...)

My application uses a TDBEdit-Field to enter a TDateTime. It is up to
the user if he enters the year after dd.mm. or not. How can I do this?
If I use 00 for the year, this means 1900 to TDateTime. Is there a way
to tell TDateTime that it hast to do without a year?

Thanks for your help,

Till/Germany

  vcard.vcf
< 1K Download
 

Re:Please Help: Ignore Year when entering a date in TDateTime


The TDateTime data type stores the date internally as a serial number so it
must have a year.

--
Bill Todd
(Sorry but TeamB cannot answer questions received via email)
(Remove nospam from my email address to contact me for any other reason)

Re:Please Help: Ignore Year when entering a date in TDateTime


If you are only after the text value and not concerned about whether
or not it's a valid date value, I would suggest a text field, not a
DateTime field. Without a year, a date is meaningless. If you just
want to add the current year for them if they leave it blank, then I
suggest using the OnExit event for the control or the
DisplayFormat/EditFormat properties of the TField to create a mask.

Woody

Quote
Till Coenen wrote in message <360D3BFB.317B...@donau.de>...
>Hi!

>How can help me with this, please (I guess it's another
>newbie-problem...)

>My application uses a TDBEdit-Field to enter a TDateTime. It is up to
>the user if he enters the year after dd.mm. or not. How can I do
this?
>If I use 00 for the year, this means 1900 to TDateTime. Is there a
way
>to tell TDateTime that it hast to do without a year?

>Thanks for your help,

>Till/Germany

Other Threads