/ Forums / Advansys Formativ / Creating Solutions with Formativ / Appointment duration from DateTime controls / Reply To: Appointment duration from DateTime controls

Support 3

If you want to store the date time value as human readable format then you need to make sure the format is convertible by your solution. Date format can vary by work-station where user can set different date format (yyyymmdd, ddmmyyyy, etc). You can use the Year(), Month(), Day(), etc method to extract the part of the date and save to the ini file. You program then need to read the part to convert to the exact date. For example:

   aDate = now
   msgbox year(aDate) & month(aDate) & day(aDate) & hour(aDate) & minute(aDate) & second(aDate)

Another approach which I will recommend to save the date as ISO format then your program can easily convert the ISO value from the ini file to date. You do not need to worry about the date format when saving as ISO format.

   iISODate = utilities.DateToISO(now)

   msgbox utilities.ISOToDate(iISODate)

Hope this helps.

Advansys Support