Skip to main content

Has anyone been able to take the shipment (or another similar transaction) created date/time field and only display the time? I was able to use the CRCase table trick to get the date column to display the date and time, but the client would like the time in a separate column. When I try to take the right most characters from the field, it displays the time in UTC time instead of our current time zone like the date/time field displays .

@hayleehicks18 not very elegant but that works:

=CSTR(PADLEFT(HOUR((SOShipment.CreatedDateTime]),2,'0'))+'h'+PADLEFT(CSTR(MINUTE((SOShipment.CreatedDateTime])),2,'0')

It will display time in 24H format. 12H display could be achieved with an IIF Statement:

=IIF(HOUR((SOShipment.CreatedDateTime])<=12,PADLEFT(CSTR(HOUR((SOShipment.CreatedDateTime])),2,'0')+'h'+PADLEFT(CSTR(MINUTE((SOShipment.CreatedDateTime])),2,'0')+ ' AM',PADLEFT(CSTR(HOUR((SOShipment.CreatedDateTime])-12),2,'0')+'h'+PADLEFT(CSTR(MINUTE((SOShipment.CreatedDateTime])),2,'0')+ ' PM')

 


@Gabriel Michaud Hi Gabriel! Thanks for the response. Do you know how I could get it to display in the same time zone conversion as the created on displays? The formula displays the time in UTC time. Also daylight savings may be a factor here. See below. Thanks for your help!

 

 


No easy way i’m afraid. It would be great if Acumatica simply exposed the time as an extra field, just like you can get the hour by appending _Hour to the field name: SOShipment.CreatedDateTime_Hour 

Two possible options:

Option 1: just shift the hour manually by adding/subtracting from the UTC time. This will not take care of daylight savings or users in different time zones

Option 2: through customization create a field with a special attribute that takes care of the formatting; you would then be able to use this field as schema field in any GI


@Gabriel Michaud  do you know if there’s a better way to accomplish this now than there was 2 years ago?


Reply