Using DateTime

ta5ta5 Member Posts: 1,164
Hi
I'm looking for a good solution to convert a date and a time to a datetime value.

This works:
evaluate(mydatetime,format(mydate) + ' ' + format(mytime);

I'm not sure concerning this is efficient and safe because of the locale setting of the os. Maybe format(10.09.2007) may be the different on a us american locale than on a swiss one.

Thanks on any input.
Regards
Thomas

Answers

  • WaldoWaldo Member Posts: 3,412
    This should be fine, I guess.

    the output of FORMAT(yourdate) will be different on a US machine then on a Swiss machine. And that's exactly what you need... .

    :-k

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • kinekine Member Posts: 12,562
    And what about using CREATEDATETIME function? :wink: 8)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • ta5ta5 Member Posts: 1,164
    CREATEDATETIME. Thats it. Somehow, I didn't find this function :oops:

    Many thanks to your conributions.
    Thomas
  • WaldoWaldo Member Posts: 3,412
    kine wrote:
    And what about using CREATEDATETIME function? :wink: 8)
    LOL
    #-o

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
Sign In or Register to comment.