Convert Text to Date

ta5
ta5 Member Posts: 1,164
Hi
Whats best to convert a string (yyyymmdd) to a date?
Btw: It works when I first prepare a new string to ddmmyyyy and then use the evaluate statement on the new string. But I'm not sure whether this works on all work stations (country settings...).

Thanks in advance
Thomas

Answers

  • ara3n
    ara3n Member Posts: 9,258
    ddmmyyyy would not work in US. evaluate would inteperts it as mmddyyyy. and it would error and get the wrong date.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • ta5
    ta5 Member Posts: 1,164
    thanks!
    so its better to use dmy2date?
    thomas
  • kriki
    kriki Member, Moderator Posts: 9,132
    ha5 wrote:
    thanks!
    so its better to use dmy2date?
    thomas
    Always better, because the other always depends on the regional settings of the PC.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • ta5
    ta5 Member Posts: 1,164
    thanks =D>
  • ara3n
    ara3n Member Posts: 9,258
    welcome. :P
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n