473,398 Members | 2,165 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,398 software developers and data experts.

Formatting Date

3
How can I convert a value entered in Date field into the locale specific format. Also, I need to validate the value entered in Date field.
Sep 24 '07 #1
5 1053
gits
5,390 Expert Mod 4TB
hi ...

welcome to TSDN ...

could you show what you have so far? ...

kind regards
Sep 24 '07 #2
rs17
3
Hi,
I have a field in HTML which accepts user inputs. But according to my application, it should accept only date values.
So, first I have to validate the value that it should be a valid date value and next, if the input is a valid date value, then it should automatically get converted into the format specified in system's locale.

I tried using :-
Expand|Select|Wrap|Line Numbers
  1. (new Date()).toDateString();
  2.  
But it returns the date in the following format:-
Mon Sep 24 2007

I don't want this format. I want the date exactly in following format:-
Sep 24, 2007

I think, now the problem must be clear to all.
Sep 24 '07 #3
pbmods
5,821 Expert 4TB
Heya, RS.

Please use CODE tags when posting source code:

[CODE=javascript]
JavaScript code goes here.
[/CODE]

To output a date in a custom format, you need to build it manually by using Date::getFullYear(), Date::getMonth() and Date::getDate(). You'll also need to use an array to store 'human-readable' month names, as Date::getMonth() will return a numerical value.
Sep 24 '07 #4
rs17
3
I am aware of what you have suggested. But the point is my application can run on various locales. How will I identify what is the format for a particular locale?

I need a function in which I can provide a format and a date which can convert the provided date into the specified format, where both the date and format are dynamic.....

Can you help?
Sep 25 '07 #5
dmjpro
2,476 2GB
I am aware of what you have suggested. But the point is my application can run on various locales. How will I identify what is the format for a particular locale?

I need a function in which I can provide a format and a date which can convert the provided date into the specified format, where both the date and format are dynamic.....

Can you help?
Have a look at this tutorial.
It may help you.
Good Luck ... :-)

Kind regards,
Dmjpro.
Sep 25 '07 #6

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

Similar topics

3
by: Jouke Langhout | last post by:
Hello all! For quite some time now, I've got the following problem: Access won't close properly when a user closes the application. An ACCESS process stays active and that process can only be...
2
by: Sara | last post by:
The problem: Conditional formatting bold, red when field Value < date() sets the field background to white - always - whether condition is met or not. I want the field unfilled and just red/bold...
2
by: johndcal | last post by:
Hello All, I have a date value that I pull from a .csv file. After reading the file and storing the values in an array the value of the date could be found in $array, for example....
2
by: David Veeneman | last post by:
How does one format a date column in a GridView control? I had assumed that the DataFormat string would do it, but MSDN only shows numeric formatting codes. Can dates be formatted using that...
4
by: Ken Wigle | last post by:
All, I would be very grateful for any help on this question. I have an application in asp.net 2.0 where I dynamically create a datatable and then bind that to a gridview. Unfortunately, the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
0
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,...
0
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...

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.