Commit 95494856 authored by Jeremy Bokobza's avatar Jeremy Bokobza

Change the unix time to be in seconds and not miliseconds

parent 0e28ba41
...@@ -18,13 +18,13 @@ namespace Breeze.Wallet.JsonConverters ...@@ -18,13 +18,13 @@ namespace Breeze.Wallet.JsonConverters
/// <inheritdoc /> /// <inheritdoc />
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{ {
return DateTimeOffset.FromUnixTimeMilliseconds(long.Parse((string)reader.Value)); return DateTimeOffset.FromUnixTimeSeconds(long.Parse((string)reader.Value));
} }
/// <inheritdoc /> /// <inheritdoc />
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{ {
writer.WriteValue(((DateTimeOffset)value).ToUnixTimeMilliseconds().ToString()); writer.WriteValue(((DateTimeOffset)value).ToUnixTimeSeconds().ToString());
} }
} }
} }
...@@ -513,7 +513,7 @@ namespace Breeze.Wallet ...@@ -513,7 +513,7 @@ namespace Breeze.Wallet
Amount = amount, Amount = amount,
BlockHeight = blockHeight, BlockHeight = blockHeight,
Id = transactionHash, Id = transactionHash,
CreationTime = DateTimeOffset.FromUnixTimeMilliseconds(blockTime ?? time), CreationTime = DateTimeOffset.FromUnixTimeSeconds(blockTime ?? time),
Index = index Index = index
}; };
trans.Add(newTransaction); trans.Add(newTransaction);
...@@ -558,7 +558,7 @@ namespace Breeze.Wallet ...@@ -558,7 +558,7 @@ namespace Breeze.Wallet
// update the block time // update the block time
if (blockTime != null) if (blockTime != null)
{ {
foundTransaction.CreationTime = DateTimeOffset.FromUnixTimeMilliseconds(blockTime.Value); foundTransaction.CreationTime = DateTimeOffset.FromUnixTimeSeconds(blockTime.Value);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment