[TIP] Extracting some part of date, time and datetime values.

Ivan Smahin IvanSmahin at public.kherson.ua
Sun May 15 11:01:44 CDT 2005


Hello Claudius,

Sunday, May 15, 2005, 10:01:22 AM, you wrote:


CS> Am 15. Mai 2005 um 00:06 Uhr schrieb Ruslan Zasukhin:

>> On 5/14/05 10:32 PM, "Claudius Sailer" <Claudius at sailer-online.de>
>> wrote:
>>
>>
>>>> Don't use such code:
>>>>
>>>>
>>>>
>>>>>> db.sqlExecute("update students set logged_in = substr(curdate(),
>>>>>> 1, 4) where
>>>>>> (ID = '4')");
>>>>>>
>>>>>>
>>>>
>>>> Because of:
>>>>
>>>> 1. We have a number of DateTime based SQL functions like YEAR(),
>>>> MONTH()...
>>>> 2. The string representation for such values may differ depending on
>>>> current DateTime format. So it's just unsafe.
>>>>
>>>
>>> but no possibility to get only date from CURDATE()!!
>>> This is very strong needed :-))
>>>

Actually we have 3 functions to work with current date-time:

CURDATE() - returns DATE
CURTIME() - returns TIME
NOW() - returns DATETIME


-- 
Best regards,
 Ivan                            mailto:IvanSmahin at public.kherson.ua



More information about the Valentina mailing list