Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question
1

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

asked 2017-11-16 11:38:14 -0500

maddog56's avatar

updated 2017-11-16 12:23:03 -0500

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-11-16 12:19:15 -0500

updated 2017-11-16 12:22:20 -0500

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.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Training Workshops

Careers

Question Tools

1 follower

Stats

Asked: 2017-11-16 11:38:14 -0500

Seen: 1,611 times

Last updated: Nov 16 '17