Skip to content

Commit 958f350

Browse files
committed
handle timestamp not set by caller
1 parent 604a9ed commit 958f350

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

AdysTech.InfluxDB.Client.Net/InfluxDatapoint.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,8 @@ public string ConvertToInfluxLineProtocol()
135135
////double has to have a . as decimal seperator for Influx
136136
fields = String.Join (",", Fields.Select (v => new StringBuilder ().AppendFormat ("{0}={1}", EscapeChars (v.Key), String.Format (System.Globalization.CultureInfo.GetCultureInfo ("en-US"), "{0}", v.Value))));
137137

138-
line.AppendFormat (" {0} {1}", fields, UtcTimestamp.ToEpoch (Precision));
138+
139+
line.AppendFormat (" {0} {1}", fields, UtcTimestamp != DateTime.MinValue ? UtcTimestamp.ToEpoch (Precision) : DateTime.UtcNow.ToEpoch (Precision));
139140

140141
return line.ToString ();
141142
}

AdysTech.InfluxDB.Client.Net/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
[assembly: AssemblyConfiguration("")]
1111
[assembly: AssemblyCompany("AdysTech")]
1212
[assembly: AssemblyProduct("AdysTech.InfluxDB.Client.Net")]
13-
[assembly: AssemblyCopyright("Copyright © AdysTech 2015")]
13+
[assembly: AssemblyCopyright("Copyright © AdysTech 2016")]
1414
[assembly: AssemblyTrademark("")]
1515
[assembly: AssemblyCulture("")]
1616

0 commit comments

Comments
 (0)