Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Long date to Short
#9
i think your best bet is to try what Gintaras said and use C# 
 here is some basic C# DateTime examples in qm
Function DateTimeExamples
Code:
Copy      Help
out
str code=
;using System;
;using System.Globalization;
,,,,,;
;public class Example
;{
,;public static void Main()
,;{
,,;string res = DateTime.ParseExact("Friday, March 23, 2018 12:05:33 AM", "dddd, MMMM d, yyyy hh:mm:ss tt", CultureInfo.InvariantCulture).ToShortDateString();
,,;Console.WriteLine(res);
,,;string a = DateTime.Now.ToShortTimeString();
,,;string b = DateTime.Now.ToLongTimeString();
,,;string c = DateTime.Now.ToLongDateString();
,,;DateTime d = DateTime.Today;
,,;Console.WriteLine(a);
,,;Console.WriteLine(b);
,,;Console.WriteLine(c);
,,;Console.WriteLine(d.ToString());
,,;DateTime now = DateTime.Now;
,,;string longdate = now.ToString("D");
,,;string shortdate = now.ToString("d");
,,;string longtime = now.ToString("T");
,,;string shorttime = now.ToString("t");        
,,;Console.WriteLine(longdate);
,,;Console.WriteLine(shortdate);
,,;Console.WriteLine(longtime);
,,;Console.WriteLine(shorttime);
,,;Console.WriteLine(DateTime.Now.ToLongTimeString().ToString());
;;;;;;;;;Console.WriteLine(DateTime.Now.ToShortTimeString().ToString());
,;}
;}

CsExec code "called Main"
there are alot more ways  start reading here      standard-date-and-time-format-strings


Messages In This Thread
Long date to Short - by ssimop - 03-08-2018, 11:51 AM
RE: Long date to Short - by Gintaras - 03-08-2018, 12:06 PM
RE: Long date to Short - by Gintaras - 03-08-2018, 12:09 PM
RE: Long date to Short - by Kevin - 03-20-2018, 06:56 PM
RE: Long date to Short - by ssimop - 03-20-2018, 07:57 PM
RE: Long date to Short - by Kevin - 03-22-2018, 04:48 AM
RE: Long date to Short - by ssimop - 03-23-2018, 01:21 AM
RE: Long date to Short - by Kevin - 03-23-2018, 03:37 AM
RE: Long date to Short - by Kevin - 03-23-2018, 06:16 AM
RE: Long date to Short - by Kevin - 03-26-2018, 06:53 AM
RE: Long date to Short - by ssimop - 03-26-2018, 07:15 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)