Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2011-12

Date format conversion function?

3 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Howard Lee Harkness

I am using SQLite in a small application, and using TDateEdit to pick a date. The date is returned in the Text field (I can't find a DateTime property in this control) in the format 'mm/dd/yyyy', and to use INSERT in SQLite, it wants dates in the format 'yyyy-mm-dd'. Yes, I can write a reformatting function, but I would expect one to be already available somewhere.

I'm having some trouble believing that there is no such function in Lazarus, but I just can't find it. If somebody here knows where such a function (or equivalent functionality in a class) may be found, please enlighten me.

TIA!

Howard Lee Harkness (214) 390-4896

Reply by email

Unknown author
to Howard Lee Harkness
Howard Lee Harkness wrote 6 lines
I am using SQLite in a small application, and using TDateEdit to pick a date. The date is returned in the Text field (I can't find a DateTime property in this control) in the format 'mm/dd/yyyy', and to use INSERT in SQLite, it wants dates in the format 'yyyy-mm-dd'. Yes, I can write a reformatting function, but I would expect one to be already available somewhere.

See FormatDateTime in sysutils.

And TDateEdit has a Date property which is of type TDateTime.

Michael.

Reply by email

Howard Lee Harkness
to Unknown author
Show quoted text 7 lines
See FormatDateTime in sysutils. And TDateEdit has a Date property which is of type TDateTime. Michael.

I discovered that about thirty minutes after I posted the request.

Thanks!

Howard Lee Harkness (214) 390-4896

Reply by email