This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Date Format

Hi

I am trying to change the date format and I did refer to the link https://community.m-files.com/forums-1552881334/f/m-files-clients/2540/date-format-change on the forum. I changed the regional settings but still no change. I used calculated value (VBScript) but the date still shows in a different format. Is there a way to show a different date format without changing the registry settings? Also can it be vault specific or its system wide

Parents Reply
  • Dear Bright-ideas.dk

    Many thanks for the response. I have attached two images, one is of the client that shows the dates of the excel sheet and the second one is the time format of the server. I have used calculated value in for the name and the code is as follow;

    Option Explicit
    Dim szName, szDate

    szName = "Shift Handover, dated "
    szDate = PropertyValues.SearchForProperty( 1021 ).TypedValue.Value

    Output = szName & szDate

    Please let me know if I am doing something wrong

Children
  • Hello,

    Please read all the article that bright-ideas.dk posted. If you follow all the steps on the server, it will work.

  • Since you are already using scripts you can manipulate the date-string to your liking inside the script. You can use a simple rearrangement using something similar to what I did in this script:

    'partial script, reformatting a date to YYYY-mm-DD
    Dim szActivityDate : szActivityDate = PropertyValues.SearchForProperty( pdActivityDate ).TypedValue.DisplayValue
    Dim szYear : szYear = right(szActivityDate,4)
    Dim szMonth : szMonth = mid(szActivityDate,4,2)
    Dim szDay : szDay = left(szActivityDate,2)
    Output = szYear &"-"& szMonth &"-"& szDay

    You can also convert UTC to local time using something like this:

    Dim dCreated : dCreated = PropertyValues.SearchForProperty(20).TypedValue.GetValueAsTimeStamp().UtcToLocalTime().GetValue()