Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# date

using System;
class Test {
   static void Main() {
      //print current datetime
      Console.WriteLine (DateTime.Now.ToString());
      //make a custom datetime
      DateTime dt = new DateTime(2018, 7, 24);
      Console.WriteLine (dt.ToString());
   }
}
Comment

c# datetime

// To convert json datetime string to datetime object in c#
// Try this

// For instance if the json string is in this format: "/Date(1409202000000-0500 )/"
// Then wrap it like below

string sa = @"""/Date(1409202000000-0500)/""";

// Create a new instance of datetime object
DateTime dt = new DateTime();

// Deserialize the json string to datetime object
dt = JsonConvert.DeserializeObject<DateTime>(sa);


// Output
// dt = "2014-08-28 3.00.00 PM"
Comment

PREVIOUS NEXT
Code Example
Csharp :: array.convertall 
Csharp :: unity waituntil coroutine 
Csharp :: c# append multiline textbox 
Csharp :: download file from url asp net web api c# 
Csharp :: how to close and reopen an app in c# 
Csharp :: how to clear datagridview c# 
Csharp :: get query string parameter from string value c# 
Csharp :: list with two values c# 
Csharp :: compile in one single exe c# 
Csharp :: hello world c# 
Csharp :: c# difference between two dates in milliseconds C# 
Csharp :: c# make first letter uppercase 
Csharp :: how to change the color of a sprite in unity 
Csharp :: unity spherecast 
Csharp :: c# write byte[] to stream 
Csharp :: debug c# console 
Csharp :: c# dictionary initializer 
Csharp :: void ontriggerenter not working 
Csharp :: cast int to enum type c# 
Csharp :: keybyvalue c# 
Csharp :: int value from enum in C# 
Csharp :: csharp sleep code 1 second 
Csharp :: c# initialize empty array 
Csharp :: C# Unit test IConfiguration 
Csharp :: get enum value from display name c# 
Csharp :: how to remove vowels from a sttring using regex c# 
Csharp :: how to add to a list c# 
Csharp :: wpf button 
Csharp :: c# named parameters 
Csharp :: function on animation exit unity 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =