Solved

FormatDateTime

Posted on 1998-11-26
1
731 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

770 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