Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@kddlb
Created August 21, 2017 22:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kddlb/7e366bb25d8af7f9eeab0b6d4310c87c to your computer and use it in GitHub Desktop.
Save kddlb/7e366bb25d8af7f9eeab0b6d4310c87c to your computer and use it in GitHub Desktop.
SillyDate
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace SillyDate
{
class Program
{
static void Main(string[] args)
{
var dateData = new Dictionary<string, int>
{
{"year", DateTime.Now.Year},
{"month", DateTime.Now.Month},
{"day", DateTime.Now.Day}
};
var serializeObject = JsonConvert.SerializeObject(dateData);
Console.WriteLine(serializeObject);
var dict = new Dictionary<string, string>()
{
{"dateData",System.Convert.ToBase64String(System.Text.Encoding.UTF8.GetBytes(serializeObject))}
};
Console.WriteLine(JsonConvert.SerializeObject(dict));
Console.ReadLine();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment