// Fetch the last record serial number issued: dynamic record; dynamic rs = DB.Query("select * from Dockets where IDDockets = '105'"); record = rs.fetchAssoc(); // Autoincrement the record serial number: var NextNumber = record["LastNumber"]; NextNumber = NextNumber + 1; values["IDCAPANo"] = NextNumber; // SAve the created date and last change baseline date: var TimeChange = DateTime.Now.ToString(); values["DateCAPACreated"] = DateTime.Now.ToString(); values["LastChange"] = DateTime.Now.ToString(); // Save the new serial number in the Dockets table: string strSQLUpdate = "update Dockets set LastNumber = " + NextNumber.ToString() + " where IDDockets = '105'"; DB.Exec(strSQLUpdate); // Insert the record: return true;
that date is always in US format, despite the field format being dd/MM/yyyy. So records entered today (May 1, 2019) display as January 1, 2019 and I haven't yet cracked the magic to save it in local (Australian) format. Specifying a string format (e.g. DatTime.Now.ToString("dd/MM/yyyy")) doesn't seem to make any difference, nor does a format of "yyyy-mm-dd" as suggested in a 2013 post.
I'd really appreciate some help.
Thanks in advance
Enterprise x64 10.1 build 32686