Solved

FormatDateTime

Posted on 1998-11-26
1
726 Views
Last Modified: 2010-04-04
In Regional Setting - Date, I'm using format like this :
     mm/dd/yy

In my program I'm using FormatDateTime function like this :

const
  MyDate = '27/11/1998';

begin
  Label1.Caption := FormatDateTime('dddd dd mmmm yyyy',StrToDate(MyDate));
end;

If I run this program, I found error !
But if I change Date in Regional Setting like this :
     dd/mm/yy

I don't found error !

What is the function FormatDateTime if this function still using Windows's date system ?
0
Comment
Question by:joely
1 Comment
 
LVL 2

Accepted Solution

by:
kjteng earned 10 total points
ID: 1348144
I don't think this error is due to formatDateTime. It is the StrToDate function that cause the error because StrToDate use the ShortDateFormat.
One way to solve your problem is to set
ShortDateFormat := 'mm/dd/yy' (or other format as you like)
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This video discusses moving either the default database or any database to a new volume.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now