Friends please help me in FORMATTING DATE

I have a Form with three text boxes
1.txtNo- Data type-Number
2.txtName-Data type-Text
3.txtDob-Data type -Date format dd/MM/yyyy
two buttons one for adding and the other for viewing
Using visual data manager I have created a database-Members with table-List having the following Fields
Mno -type-integer
Name-type-text
Dob-type -date/time
I added 2 records, in first record the Dob is 18/05/1952 (dd/MM/yyyy format)
in the second Dob is 05/11/1955 (dd/MM/yyyy format)
When we view the first record the Dob is displayed as 5/18/1952 (M/dd/yyyy format)
In the second one Dob is displayed as 5/11/1955 (d/MM/yyyy format)
Why this difference ?I want always the Dob displayed in dd/MM/yyyy format
When the date is =<12 the display is almost correct, But when the date is above 12 the date portion is shifted to month portion and month to date portion

How can I overcome this? Please help me . I want always the date in dd/MM/yyyy format

Recommended Answers

All 5 Replies

somebody please help me. please.... please.......

use

Print Format$(your_date, "dd/mm/yyyy")

where your_date is the date in any format

I am confused Wher and how to put this code

My code is this

    TxtTdate = Format$(Date, "dd/MMM/yyyy")

This works well as 16/Nov/2013
But I want always as dd/mm/yyyy 16/11/2013

If I change the code like this

    TxtTdate = Format$(Date, "dd/MM/yyyy")

Then the problem begins

firstly , i don't see any problem in the code.

But I want always as dd/mm/yyyy 16/11/2013

Try This:

Format(Now, "dd/mm/yyyy")

Above statement will display present date.So you can also print desired in the Specific Pattern by replacing Now with your date type variable.

the above statement will result in what you want.(16/11/2013).

hope this helps you.

ok thank u , Now I found out my mistakes,it works as I wish.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.