Convert File Modified Date Time

More
2 years 1 month ago - 2 years 1 month ago #23945 by prashant
Hellos,
In a package I am using the variable (File Modified) , the value is 2024-06-17 07:38:03.473 . Assuming the variable is stored in #file-modified#

Can I convert the the time component to

1. AM/PM  so 07:38 AM (I have no idea how to)
2.  24 Hours 07:38 - Somehow use RightDelete with it? - RightDelete(GetVariable('#file-modified#'),6) ?
Last edit: 2 years 1 month ago by prashant.

Please Log in or Create an account to join the conversation.

More
2 years 1 month ago - 2 years 1 month ago #23946 by admin
This can be easily done using calculation
String is converted to date type first
Than it is converted back to string using different format. 

var StringValue : string;
var DateValue : Date;
begin
 StringValue:='2024-06-17 07:38:03.473';
 DateValue:= FormatStrToDate(StringValue,'yyyy-mm-dd hh:nn:ss.fff');
 SetVariable('#date1#',FormatDateTime('hh:nn:ss ampm' ,DateValue));
 Result:=true;
end;

This wiki page has list of formats supported (It is not full list, we will update it)
www.etl-tools.com/wiki/advanced-etl-proc...vanced/date-formats/

 

Mike
ETL Architect
Last edit: 2 years 1 month ago by admin.

Please Log in or Create an account to join the conversation.

Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Read more
Marketing
Set of techniques which have for object the commercial strategy and in particular the market study.
Google
Accept
Decline
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Google Analytics
Accept
Decline
Functional
Tools used to give you more features when navigating on the website, this can include social sharing.
Advertisement
If you accept, the ads on the page will be adapted to your preferences.
Google Ad
Accept
Decline
Save