diff --git a/Functions/Send-GraphiteMetric.ps1 b/Functions/Send-GraphiteMetric.ps1 index be824fd..2bb232e 100644 --- a/Functions/Send-GraphiteMetric.ps1 +++ b/Functions/Send-GraphiteMetric.ps1 @@ -76,8 +76,10 @@ function Send-GraphiteMetric # If Received A DateTime Object - Convert To UnixTime if ($DateTime) { + $utcDate = $DateTime.ToUniversalTime() + # Convert to a Unix time without any rounding - $UnixTime = [uint64]$DateTime.ToUniversalTime() + [uint64]$UnixTime = [double]::Parse((Get-Date -Date $utcDate -UFormat %s)) } # Create Send-To-Graphite Metric @@ -94,4 +96,4 @@ function Send-GraphiteMetric } SendMetrics @sendMetricsParams -} \ No newline at end of file +}