I have a list of Unix Time Stamps for October 20, 2018 which looks something like this
Unix Time Stamp Time Converted
- 1539993951 - 10/20/2018 @ 12:05am (UTC)
- 1539997544 - 10/20/2018 @ 1:05am (UTC)
- 1540001143 - 10/20/2018 @ 2:05am (UTC)
- 1540004743 - 10/20/2018 @ 3:05am (UTC)
- 1540008353 - 10/20/2018 @ 4:05am (UTC)
- 1540011941 - 10/20/2018 @ 5:05am (UTC)
- 1540015547 - 10/20/2018 @ 6:05am (UTC)
- 1540019148 - 10/20/2018 @ 7:05am (UTC)
- 1540022753 - 10/20/2018 @ 8:05am (UTC)
- 1540026346 - 10/20/2018 @ 9:05am (UTC)
- 1540029951 - 10/20/2018 @ 10:05am (UTC)
- 1540033550 - 10/20/2018 @ 11:05am (UTC)
- 1540037150 - 10/20/2018 @ 12:05pm (UTC)
- 1540040746 - 10/20/2018 @ 1:05pm (UTC)
- 1540044347 - 10/20/2018 @ 2:05pm (UTC)
- 1540047951 - 10/20/2018 @ 3:05pm (UTC)
- 1540051549 - 10/20/2018 @ 4:05pm (UTC)
- 1540055144 - 10/20/2018 @ 5:05pm (UTC)
- 1540058750 - 10/20/2018 @ 6:05pm (UTC)
- 1540062349 - 10/20/2018 @ 7:05pm (UTC)
- 1540065938 - 10/20/2018 @ 8:05pm (UTC)
- 1540069549 - 10/20/2018 @ 9:05pm (UTC)
- 1540073134 - 10/20/2018 @ 10:05pm (UTC)
- 1540076744 - 10/20/2018 @ 11:05pm (UTC)
I have a method to pull the Unix Time Stamp for the current time
public static Int32 unixTimeStampNow()
{
Int32 unixTimestamp = (Int32)(DateTime.Now.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;
Console.WriteLine("The Unix Timestamp is ", unixTimestamp);
return unixTimestamp;
}
Current time stamp: 1596893776 08/08/2020 @ 1:45pm (UTC)
If I wanted to find the closest time stamp to the time of day from the current time stamp (1:45pm) which would be (1540044347 - 10/20/2018 @ 2:05pm (UTC)) in the above list. How could I go about that? Appreciate any help in advance!