Adjusting time for entries in a dataseries
Author: drawal
Creation Date: 2/26/2009 1:47 PM
profile picture

drawal

#1
What is the right way to do this? When I try
series.Date[i].Hour = 16;
I get a "field is read-only" error message

Background:
1. I am importing dataset from a csv file that has two columns, a date and an indicator value
2. The dates get imported with 12:00 AM as the time by default
3. I need to change the time to 4:00 pm

Thanks in advance...
Dhar



profile picture

Eugene

#2
QUOTE:
series.Date[i].Hour = 16;
I get a "field is read-only" error message


Yes, because the Date collection is read-only:
FAQ | Strategies and WealthScript

QUOTE:
3. I need to change the time to 4:00 pm


.NET defaults the DateTime field to 12:00 AM when no time was specified (it's been discussed recently: Question about dates of daily data).

The easiest option is to change your file itself by adding the Time field. For example, with the help of a script to automate things.