![]() |
|
Not a valid time format? - Printable Version +- Atozed Forums (https://www.atozed.com/forums) +-- Forum: Atozed Software (https://www.atozed.com/forums/forum-1.html) +--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html) +---- Forum: English (https://www.atozed.com/forums/forum-16.html) +----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html) +----- Thread: Not a valid time format? (/thread-1766.html) Pages:
1
2
|
RE: Not a valid time format? - Mikael Nilsson - 07-03-2020 (07-03-2020, 06:57 AM)Mikael Nilsson Wrote:(07-02-2020, 03:31 PM)SorenJensen Wrote: Also you can use .value in the assign: Hi, We have identified the problem now. We are running the webpool with a specific Identity (User). That user id was not assign with Swedish Settings. The same situation with batchjobs started with the scheduler. It is specific user for Scheduler to. Only problem is that FormatDateTime('c',now) still is problem. When rewrite it to FormatDateTime('yyyy-mm-dd hh:nn s',now) it worked.
RE: Not a valid time format? - Alexandre Machado - 07-04-2020 The correct way of doing it is: Code: UserSession.FDQryUsersMod.FieldByName('Anddat').AsDateTime := Now;As Soren mentioned This is not related to IntraWeb directly. For some reason, your ShortDate format variable is being set to a different format (yyyy-mm-dd instead of dd/mm/yyyy) as you expect. One thing that you must do if you convert from string to date frequently using FormatDateTime() (or DateTimeToStr()/StrToDate() etc.) is setting the desired format variables when the application starts: In your OnConfig event, in ServerController, set it as desired: Code: procedure TIWServerController.IWServerControllerBaseConfig(Sender: TObject);nevertheless, I still recommend you to set the field value using AsDateTime which performs better, doesn't require multiple conversions from/to string and doesn't depend on current format settings |