1

How to convert date/time values in a CSV Output File

Please note the following output data to a CSV file from EnergyPlus.

Date/Time,Environment:Site Outdoor Air Drybulb Temperature C
07/07 01:00:00,18.416666666666669
...etc.
...etc.
...etc.
07/07 24:00:00,18.0

Note that the last hour on 07/07 is 24:00:00. I was writing a custom interface to these CSV files and cannot convert the string "07/07 24:00:00" to a real date time. I am using C# in Visual Studio. According to Microsoft the hour has to be a number between 00 and 23. Any advice here or do I just need to subtract 1 from all the times? Seems like hours should come out from EnergyPlus as 00 to 23? Or maybe an option to do such? Thanks.

From Microsoft:

The "HH" custom format specifier

The "HH" custom format specifier (plus any number of additional "H" specifiers) represents the hour as a number from 00 through 23; that is, the hour is represented by a zero-based 24-hour clock that counts the hours since midnight. A single-digit hour is formatted with a leading zero.

maddog56's avatar
71
maddog56
asked 2017-11-16 11:38:14 -0500
ericringold's avatar
10.6k
ericringold
updated 2017-11-16 12:23:03 -0500
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

Here is one python-based way to do it (Hat tip @Clayton Miller) that might give you some ideas.

PS: Thankfully, the EnergyPlus team knows it's an issue and are hopefully working on it.

ericringold's avatar
10.6k
ericringold
answered 2017-11-16 12:19:15 -0500, updated 2017-11-16 12:22:20 -0500
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments