![]() | |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have a string that looks like this "2009-01-31 14:43:21" its the ISO Standard I would like to convert this type a variable of type datetime.is there an easy way to do this in Objectpal? I am using paradox 9 on Win XP |
#3
| |||
| |||
|
|
One has to have their bde date setting matching this format, otherwise you would have to manipulate this input to mathc your setting and then you can use normal date/time functions. Bring it in to your code as a string value, break it down into date and time pieces, convert to match your bde setting and you should then have valid date/time fields. |
#4
| |||
| |||
|
|
Jim & O.P., One has to have their bde date setting matching this format, otherwise you would have to manipulate this input to mathc your setting and then you can use normal date/time functions. *Bring it in to your code as a string value, break it down into date and time pieces, convert to match your bde setting and you should then have valid date/time fields. In addition, remember that you can cast a date as date(mm, dd, yyyy), where each is an integer. *Unfortunately, you can't do the same with a time. *This will let you ignore the date bde setting. * And, I agree that it is much easier to split the dateTime into a date() and a time() component to work with. *In the end, just merge them back together using: * *myDateTime = dateTime(myDate) + time(myTime) HTH, Jim Moseley |
#5
| |||
| |||
|
|
Thanks for the help. I have another question now. How do I detect in code what my BDE datetime format is ? |
#6
| |||
| |||
|
|
I have a string that looks like this "2009-01-31 14:43:21" its the ISO Standard I would like to convert this type a variable of type datetime.is there an easy way to do this in Objectpal? I am using paradox 9 on Win XP |
![]() |
| Thread Tools | |
| Display Modes | |
| |