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
/// <inheritdoc />
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 />
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
Amount = amount,
BlockHeight = blockHeight,
Id = transactionHash,
CreationTime = DateTimeOffset.FromUnixTimeMilliseconds(blockTime ?? time),
CreationTime = DateTimeOffset.FromUnixTimeSeconds(blockTime ?? time),
Index = index
};
trans.Add(newTransaction);
......@@ -558,7 +558,7 @@ namespace Breeze.Wallet
// update the block time
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