In C#, a date can have a min value which is 1/1/0001 12:00:00 AM
. This is nice in validation situations.
I tried producing this value in JavaScript but it's not working:
var minDate = new Date("1/1/0001 12:00:00");
If I convert this to toISOString()
, I'm getting "2001-01-01T18:00:00.000Z"
.
My API backend in C# is expecting a date value and I don't want to arbitrarily create my own version of DateTime.MinValue
in JavaScript. Is there a way for me to produce this value in JavaScript?