473,396 Members | 1,938 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Date Format

15
Hi all,

How do you make the date format comply with dd/mm/yy?

When I test dates entered it changes 13/07/1968 to 07/13/1968 (to place month first) but if you type 02/03/1968 where 03 is the month it assumes 02 is the month and does not switch them causing errors.

Also I want the year to be 2 digits (07 representing 2007) but sometimes if I enter a date as 13/02/07 it assumes the year to be 2013 returning 02/07/2013. Why can't the dates do what I want them to do?

I have spent hours on this and am totally bummed out.

deejow
Aug 2 '07 #1
9 3619
damonreid
114 Expert 100+
Is it possible to use the dd/mmm/yy format thus getting around this problem?

Another solution is to add a calendar control to the onclick for each date field; this will bring up a calendar and allow them to select a date from that?
Aug 2 '07 #2
MikeTheBike
639 Expert 512MB
Hi

This is a perennial problem when you local computer date setting is UK ?? ie dd/mm/yy as opposed to Microsofts (US) default of mm/dd/yy.

The solution will depend on where you entering the date and how are you are using them from there?

MTB
Aug 3 '07 #3
Twanne
65
I've been searching for the solution of this problem for a very long time. Now I made a "stupid" function that switches the dates day and month if the day is smaller than 12.

Expand|Select|Wrap|Line Numbers
  1. Public Function dateFormat(datum) As String
  2. Dim test As Integer
  3.         days = Format(datum, "dd")
  4.         months = Format(datum, "mm")
  5.         years = Format(datum, "yyyy")
  6.         If (day < 13) Then
  7.             test = days
  8.             days = months 
  9.             months = test
  10.         End If
  11.         dateFormat = days & "/" & months & "/" & years
  12. End Function
The when you have the string you can put it bacj in date format with CDate() or somthing
Aug 3 '07 #4
MikeTheBike
639 Expert 512MB
This is a perennial problem when you local computer date setting is UK ?? ie dd/mm/yy as opposed to Microsofts (US) default of mm/dd/yy.

The solution will depend on where you entering the date and how are you are using them from there?
I still think we need to know the aswers to these two questions !

MTB
Aug 3 '07 #5
Twanne
65
I understand what you mean but I have searched for a few days (maybe weeks) and I couldn't find it. So I've solved it this way
Aug 3 '07 #6
deejow
15
Is it possible to use the dd/mmm/yy format thus getting around this problem?

Another solution is to add a calendar control to the onclick for each date field; this will bring up a calendar and allow them to select a date from that?
Mmmmm. I like the sound of the calendar control. How do I create such a blessed thing?

deej
Aug 4 '07 #7
puppydogbuddy
1,923 Expert 1GB
Mmmmm. I like the sound of the calendar control. How do I create such a blessed thing?

deej
Here is a link to a ready made calendar using an Access form, which has several advantages over an ActiveX. Step by step instructions are provided in the link.

http://allenbrowne.com/ser-51.html
Aug 4 '07 #8
deejow
15
Hi

This is a perennial problem when you local computer date setting is UK ?? ie dd/mm/yy as opposed to Microsofts (US) default of mm/dd/yy.

The solution will depend on where you entering the date and how are you are using them from there?

MTB
Yes,

It is simple when you know where to look. The problem was fixed by going to: Control Panel > Regional and Language Options > (tab) Regional Options - select your region correctly then > (button) Customise > (tab) Date - change options to suit your needs.

An input mask of 99/99/99 was also used where '9' indicates a number from zero to 10 is required.

Thnx to all for helping.
Aug 4 '07 #9
deejow
15
Here is a link to a ready made calendar using an Access form, which has several advantages over an ActiveX. Step by step instructions are provided in the link.

http://allenbrowne.com/ser-51.html
That is one of the coolest things I have ever seen...erm...I need to get out more.

Thnx dude
Aug 4 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

15
by: Simon Brooke | last post by:
I'm investigating a bug a customer has reported in our database abstraction layer, and it's making me very unhappy. Brief summary: I have a database abstraction layer which is intended to...
2
by: amith | last post by:
hi I have written javascript for comparing two dates in US format and finding out whether the start date is greater than the end date and vice versa. In this attempt i have instantiated the...
4
by: Richard Hollenbeck | last post by:
I'm trying to write some code that will convert any of the most popular standard date formats twice in to something like "dd Mmm yyyy" (i.e. 08 Jan 1908) and compare the first with the second and...
3
by: Lyn | last post by:
Hi, I am developing a project in which I am checking for records with overlapping start/end dates. Record dates must not overlap date of birth, date of death, be in the future, and must not...
5
by: Macca | last post by:
Hi, I have a table which has a date/time field. I am storing them as follows :- 01/01/2005 11:25 01/01/2005 19:44 02/01/2005 05:04
12
by: Assimalyst | last post by:
Hi, I have a working script that converts a dd/mm/yyyy text box date entry to yyyy/mm/dd and compares it to the current date, giving an error through an asp.net custom validator, it is as...
20
by: andreas | last post by:
When I copy a vb.net project using date formats from one PC with a windows date format f.e. dd/mm/yyyy to another PC having a format yy/mm/dd then I get errors. How can I change for a while in the...
30
by: fniles | last post by:
On my machine in the office I change the computer setting to English (UK) so the date format is dd/mm/yyyy instead of mm/dd/yyyy for US. This problem happens in either Access or SQL Server. In the...
4
by: OzNet | last post by:
I have some functions to calculate the working days in a given period. This includes a table that is queried to calculate the number of public holidays that don’t occur on a weekend. If I test...
11
ollyb303
by: ollyb303 | last post by:
Hello, I am using a dynamic crosstab report to track performance statistics for my company and I have hit a problem. I would like the option to track stats daily (for the last 7 complete...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.