Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Help WIth C# TTOC(datetime(),2) Equiv
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 8.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01273992
Message ID:
01273999
Vues:
12
Kirk,
Here is how it was implemented in the VFP Toolkit for .NET
/// <summary>
/// Receives a Date as a parameter and returns a string of that date and time. 
/// (Use MyDate.ToShortDateString() and MyDate.ToShortTimeString() instead)
/// </summary>
/// <param name="dDate"></param>
/// <returns></returns>
public static string TTOC(System.DateTime dDate)
{
	return String.Concat(dDate.ToShortDateString(), " ", dDate.ToShortTimeString()) ;
}
>I need to include the whole datetime system value into a string but formatted in YYYYMMDDHHMMSS format, I'm sure this is really easy to do in C#...but I haven't found it yet. Hoping someone knows off the top of their head.
>
>
string DateString = System.DateTime.Now.ToString()
>
>Returns: 12/7/2007 11:33:55 AM
>
>How can I have it return a string in the same format as the vfp TTOC(DATETIME(),1)?
>
>Desired Result is: 20071207113355
>
>Thanks
>
>Kirk
Semper ubi sub ubi.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform