Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

FormatDateTime

Posted on 1998-11-26
1
Medium Priority
?
751 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 2

Accepted Solution

by:
kjteng earned 40 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

664 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