rtc DD-MM-YY to mysql YYYY-MM-DD-HH-MM

For general Flowcode discussion that does not belong in the other sections.
Post Reply
viktor_au
Posts: 62
http://meble-kuchenne.info.pl
Joined: Wed Jul 12, 2023 7:09 am
Has thanked: 13 times
Been thanked: 19 times

Flowcode v11 rtc DD-MM-YY to mysql YYYY-MM-DD-HH-MM

Post by viktor_au »

Hi all
The mysql table requires the datetime format as: YYYY-MM-DD HH:MM:SS
Flowcode RTC component gives me a choice of:
0= DD:MM:YY
1= MM:DD:YY

Looks like I have to read and save the values separately as:
YY, MM, HR, MIN (set Secs as 00)
And reformat it to:
YYYY-MM-DD-HH-MM-00
----------------------
Is it some way to do it faster?
Thanks

Steve-Matrix
Matrix Staff
Posts: 2028
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 301 times
Been thanked: 469 times

Re: rtc DD-MM-YY to mysql YYYY-MM-DD-HH-MM

Post by Steve-Matrix »

Hi Viktor,

We're looking into this and hopefully will make an updated component soon.

chipfryer27
Valued Contributor
Posts: 2105
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 469 times
Been thanked: 699 times

Re: rtc DD-MM-YY to mysql YYYY-MM-DD-HH-MM

Post by chipfryer27 »

Hi Viktor

Until Steve updates the component, could you not have your server convert?

You may be able to use the DATE_FORMAT and TIME_FORMAT mysql commands to change.

Just a thought.

Regards

viktor_au
Posts: 62
Joined: Wed Jul 12, 2023 7:09 am
Has thanked: 13 times
Been thanked: 19 times

Re: rtc DD-MM-YY to mysql YYYY-MM-DD-HH-MM

Post by viktor_au »

Thanks.
I think it is easy to re-format the rtc datetime format into a mysql friendly string.
Would be great if you can insert this function into a component.

Post Reply