1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- using Newtonsoft.Json;
- using System;
- using System.Collections.Generic;
- using System.Net.Http;
- using System.Threading.Tasks;
- namespace EVCB_OCPP.WSServer
- {
- class Program
- {
- static void Main(string[] args)
- {
- Dictionary<long, long> dictionary = new Dictionary<long, long>()
- {
- { DateTimeOffset.Now.AddDays(-3).ToUnixTimeSeconds(), DateTimeOffset.Now.ToUnixTimeSeconds()},
- { DateTimeOffset.Now.AddDays(-2).ToUnixTimeSeconds(), DateTimeOffset.Now.ToUnixTimeSeconds()},
- { DateTimeOffset.Now.AddDays(-1).ToUnixTimeSeconds(), DateTimeOffset.Now.ToUnixTimeSeconds()}
- };
- var ttt= JsonConvert.SerializeObject(dictionary);
- Console.WriteLine("====================================================================================================");
- Console.WriteLine("====================================================================================================");
- Console.WriteLine("== ==");
- Console.WriteLine("== ------------ ----------- ------------- ------------- ==");
- Console.WriteLine("== --- --- ---- ---------------- ---------------- ==");
- Console.WriteLine("== --- --- ---- ---- --- ---- --- ==");
- Console.WriteLine("== --- --- ---- ---- --- ---- --- ==");
- Console.WriteLine("== --- --- ---- ---- ------------- ---- ------------- ==");
- Console.WriteLine("== --- --- ---- ---- ----------- ---- ----------- ==");
- Console.WriteLine("== --- --- ---- ---- ---- ==");
- Console.WriteLine("== --- --- ---- ---- ---- ==");
- Console.WriteLine("== ----------- ----------- ---- ---- ==");
- Console.WriteLine("== ==");
- Console.WriteLine("====================================================================================================");
- Console.WriteLine("====================================================================================================");
- ProtalServer s = new ProtalServer();
- Console.WriteLine("Starting Server...");
- s.Start();
- Console.Read();
- }
- public static object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
- {
- DateTime? timevalue = null;
- if (reader.Value != null)
- {
- DateTime date = ((DateTime)reader.Value).ToLocalTime();
- timevalue = new DateTime(date.Year, date.Month, date.Day, date.TimeOfDay.Hours, date.TimeOfDay.Minutes, date.TimeOfDay.Seconds, 000);
- }
- return timevalue;
- }
- }
- }
|