Home » U++ Library support » U++ SQL » formatting time to pass to sqlite
formatting time to pass to sqlite [message #52276] |
Mon, 26 August 2019 02:28 |
|
Hi-
I am fooling with homebudget trying to get dates and times formatted to send to SQLite.
I can get the date part sent but the time is not working.
struct ConvTime1 : Convert
{
Value Format(const Value &q) const
{
Time t = (Time) q;
return q.IsNull() ? "" : UPP::Format("%.2d/%.2d/%.4d %.2d:%.2d:%.2d", t.month, t.day, t.year, t.hour, t.minute, t.second);
}
};
events.AddColumn(START_TIME).Edit(t1).SetConvert(Single<ConvTime1>()).Default(GetSysTime());
This code returns in sqlite db 2019-08-25 and omits the time information.
T1 is an EditString.
START_TIME is an integer in sqlite.
Thanks for any cool tips for persisting time.
roboloki
|
|
|
|
|
Goto Forum:
Current Time: Sun Oct 06 13:57:07 CEST 2024
Total time taken to generate the page: 0.00829 seconds
|