Shankar S
Shankar S

Reputation: 51

Lotus notes datetime

I have a datetime column in lotus notes which has value like 01/02/2019 01:01:01 PM.

I need to export the data into csv file in the below format:
2019-01-02 13:01:01.000

Tried changing the column properties in the view but while exporting the data is changed to 01/02/2019 01:01:01.

Here AM/PM is getting ignored.

Please suggest a way to do this properly. Thanks in advance.

Upvotes: 1

Views: 114

Answers (1)

Roman K.
Roman K.

Reputation: 965

Use this formula in your view column, where DateField is the field with date.

year := @Text(@Year(DateField));
month := @Right("0" + @Text(@Month(DateField)) ; 2);
day := @Right("0" + @Text(@Day(DateField)) ; 2);
hour := @Right("0" + @Text(@Hour(DateField)) ; 2);
minute := @Right("0" + @Text(@Minute(DateField)) ; 2);
second := @Right("0" + @Text(@Second(DateField)) ; 2);


year + "-" + month + "-" + day + " " + 
hour + ":" + minute + ":" + second + ".000"

Those @Right functions will pad your values with zeroes when needed.

Upvotes: 3

Related Questions