DateTime Autoset Mode -- UTC (GetUTCDate())

2 posts, 0 answers
  1. Tom
    Tom avatar
    16 posts
    Member since:
    Sep 2012

    Posted 08 Nov 2013 Link to this post


    I have a mapping with the following defined:

    HasProperty(x => x.ADateTimeField).IsCalculatedOn(DateTimeAutosetMode.Insert);

    This correctly sets the date on Inserts, but I have two questions:

    1.   This will be the DATABASE SERVER time, in all cases -- is that correct?

    2.   Is there any way to set this to the UTC time?


    Thanks
  2. Ady
    Admin
    Ady avatar
    589 posts

    Posted 13 Nov 2013 Link to this post

    Hello Tom,,

    1) This is the client side generated value - DateTime.Now. 
    2)In order to specify that a UTC value should be generated you can set the 'BackendConfiguration.Runtime.UseUTCForAutoSetValues=true'

    Hope this helps. 
    Do get back in case you need further assistance.

    Regards,
    Ady
    Telerik
    OpenAccess ORM Q3 2013 simplifies your model operations even further providing you with greater flexibility. Check out the list of new features shipped with our latest release!
  3. DevCraft banner
Back to Top