Property: TimeFormat for Formatter
- Updated2024-09-12
- 3 minute(s) read
DataPlugin > Properties > Property: TimeFormat for Formatter
Property: TimeFormat for Formatter
Specifies the format for the time values in the file.
Object.TimeFormat
Object | Formatter Object with this property |
Object.TimeFormat | String with read and write access |
Use the following format specifications for the time format:
Y | Year |
M | Month |
D | Day |
h | Hour |
m | Minute |
s | Second |
f | Fraction of a second |
pp | Identifies am / pm |
![]() | Note The year formatting automatically extends to 4 characters so that the specification YY becomes YYYY. When DIAdem reads in the data, the correct century precedes. The year 99 becomes 1999 and the year 05 becomes 2005. |
![]() | Note Normally seconds and minutes are in the value range 0-59, hours in the value range 0-23, days in the value range 1-31, and months in the values range 1-12. If one of these values to be read exceeds its value range, the value is converted into the next value. For example, the time value 00:65:10 in the file becomes 01:05:10 and the time value 54:30:00 becomes 03.01.0000 06:10:00. |
The following example shows the settings required for reading the lines listed below:
28.06.2004 16:28:20; 0.001234¶ 28.06.2004 16:28:21; 0.002398¶ 28.06.2004 16:28:22; 0.001296¶ 28.06.2004 16:28:23; 0.001628¶ 28.06.2004 16:28:24; 0.001683¶
The TimeFormat property specifies the time format to be read.
File.Formatter.TrimCharacters = " " File.Formatter.LineFeeds = vbNewLine File.Formatter.Delimiters = ";" File.Formatter.TimeFormat = "DD.MM.YYYY hh:mm:ss" Dim oChn, oGrp Set oGrp = Root.ChannelGroups.Add("MyChannelGroup") Set oChn = oBlock.Channels.Add("Time",eTime) Call oGrp.Channels.AddDirectAccessChannel(oChn) Set oChn = oBlock.Channels.Add("YShift",eR64) Call oGrp.Channels.AddDirectAccessChannel(oChn)
The following example shows the settings required for reading the lines listed below:
54:30:0¶ 60:30:0¶ 66:30:0¶ 72:30:0¶ 78:30:0¶ 84:30:0¶ 90:30:0¶
The TimeFormat property specifies the time format to be read.
File.Formatter.Delimiters = ";" File.Formatter.LineFeeds = vbNewLine File.Formatter.TimeFormat = "hh:mm:ss" Dim oBlock : Set oBlock = File.GetStringBlock() Dim oDAChn : Set oDAChn = oBlock.Channels.Add("FileData", eTime) Dim oGrp : Set oGrp = Root.ChannelGroups.Add("MyChannelGroup") Dim oIChn : Set oIChn = oGrp.Channels.AddImplicitChannel("ValueIndex", 1, 1, oDAChn.Size(), eI32) Call oGrp.Channels.AddDirectAccessChannel(oDAChn)