Solved

FormatDateTime

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

734 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