473,583 Members | 2,875 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Date Format

15 New Member
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 3661
damonreid
114 Recognized Expert New Member
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 Recognized Expert Contributor
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 New Member
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 Recognized Expert Contributor
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 New Member
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 New Member
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 Recognized Expert Top Contributor
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 New Member
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 New Member
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
42993
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 mediate between webapps and arbitrary database backends using JDBC. I am very unwilling indeed to write special-case code for particular databases. Our...
2
5052
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 date object with the date string which the user inputs from a pop up calendar. somewhat like this..........
4
5364
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 calculate days, months, and years. This is not for a college course. It's for my own personal genealogy website. I'm stumped about the code. I'm...
3
11574
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 overlap existing records from the same table. I had this all working some time ago, but recently when I have gone back to do more testing, part of...
5
816
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
29439
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 follows: function doDateCheckNow(source, args) { var oDate = document.getElementById(source.controltovalidate); // dd/mm/yyyy
20
35452
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 project the date format in vb.code ( not in Windows) and how can I find out which date format the PC Windows is using. Thanks for any response
30
5683
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 database I have a table with Date/time column. The database is located on a machine that is set to dd/mm/yyyy also. When I enter date 7/1/08 (as in...
4
3048
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 the function using the intermediate window, it works fine. However, when I pass the dates from the code attached to my form, the results are inaccurate....
11
6176
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 days), weekly (for the last 6 weeks) and monthly (for the last 6 complete months). Daily and monthly are not causing me a problem - I have used the...
0
7888
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8159
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7922
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8185
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6571
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5689
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5366
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3811
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
1147
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.