Login Page - Create Account

Support Board


Date/Time: Mon, 06 May 2024 16:16:10 +0000



Post From: best way to convert SCDateTime to db and back

[2020-08-29 08:21:58]
User658985 - Posts: 30
I'm reworking all my studies to support the new SCDateTime format. I tried a couple of things and it didn't quite work, thought i'd just ask you guys. So whats the best way to save this as a string to a db, then convert it back to SCDateTime? From what i understand, its an int now, so i tried something like this but didnt work:


int dateInt = sc.CurrentSystemDateTime.GetDate();
  SCString dateStr = SCString().Format("%d", dateInt);
  SCDateTime dt;
  dt.SetDate(dateInt);


I could simply just continue to save it as a double. Is there a preferred way that allows for better future compatibility?