Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
A Date in 05/11/2006 Format
Old 11-06-2006, 03:26 AM A Date in 05/11/2006 Format
Novice Talker

Posts: 7
Trades: 0
Hello all,
Plz help me,
how to get the date in 05/11/2006 format using javascript ,
i got throough Date function but is in 5/11/2006,
plz give me the code.
vin.
vin_pll is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 11-06-2006, 04:06 AM Re: A Date in 05/11/2006 Format
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
you need the formatDate() function from http://www.mattkruse.com/javascript/date/source.html
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-06-2006, 04:19 AM Re: A Date in 05/11/2006 Format
Novice Talker

Posts: 7
Trades: 0
Thank u for reply,

But plz simplify it
and exactly give me because iam new to this and iam not understanding
much plz help me.plz give me direct code.
vin_pll is offline
Reply With Quote
View Public Profile
 
Old 11-06-2006, 04:30 AM Re: A Date in 05/11/2006 Format
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
unless you are going to give me FTP access to your site and I write the page for you, it's difficult to be more simpler.

The actual code is in the page I linked to and clicking the links ([Toolbox] [Example]) at the top will tell you how to use it.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-06-2006, 04:32 AM Re: A Date in 05/11/2006 Format
Novice Talker

Posts: 9
Location: Russian Federation
Trades: 0
Code:
 
function F() {
  var d = new Date, dd = d.getDate(), 
  mm = d.getMonth() - 2, yy = d.getFullYear();
  return ('' + ((dd < 10) ? '0' + dd : dd) + '/' + 
    ((mm < 10) ? '0' + mm : mm) + '/' + yy); 
}
alert(F());
_ru_ is offline
Reply With Quote
View Public Profile
 
Old 11-06-2006, 05:20 AM Re: A Date in 05/11/2006 Format
Novice Talker

Posts: 7
Trades: 0
Hello sir ,
thank u for reply,
i wrote in this way,

<head>
function a() {
var d = new Date, dd = d.getDate(),
mm = d.getMonth() - 2, yy = d.getFullYear();
return ('' + ((dd < 10) ? '0' + dd : dd) + '/' +
((mm < 10) ? '0' + mm : mm) + '/' + yy);
}
alert(F());
</head>
<body onload="a()">
but i didnot get any output plz help me sir ,
give me the code sir.plz its urgent sir.
vin_pll is offline
Reply With Quote
View Public Profile
 
Old 11-06-2006, 05:49 AM Re: A Date in 05/11/2006 Format
Novice Talker

Posts: 9
Location: Russian Federation
Trades: 0
vin pll
Example:
Code:
<div id='test'></div>
<script type='text/javascript'>
function F() {
  var d = new Date, dd = d.getDate(), 
  mm = d.getMonth() - 2, yy = d.getFullYear();
  return ('' + ((dd < 10) ? '0' + dd : dd) + '/' + 
    ((mm < 10) ? '0' + mm : mm) + '/' + yy); 
}
document.getElementById('test').innerHTML = F();
</script>
_ru_ is offline
Reply With Quote
View Public Profile
 
Old 11-06-2006, 05:55 AM Re: A Date in 05/11/2006 Format
Novice Talker

Posts: 7
Trades: 0
Hello sir,

Code:
 
function a() {
var d = new Date, dd = d.getDate(), 
mm = d.getMonth() - 2, yy = d.getFullYear();
return ('' + ((dd < 10) ? '0' + dd : dd) + '/' + 
((mm < 10) ? '0' + mm : mm) + '/' + yy); 
}
This code is working sir,
Thank u sir ,really u r genius u have solved my problem ,thanks a lot.

Last edited by vin_pll; 11-06-2006 at 05:57 AM..
vin_pll is offline
Reply With Quote
View Public Profile
 
Old 11-09-2006, 03:26 AM Re: A Date in 05/11/2006 Format
seomumbai's Avatar
Skilled Talker

Posts: 98
Trades: 0
ther one thing called as format metod by which you can format the required date.
seomumbai is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to A Date in 05/11/2006 Format
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.27993 seconds with 12 queries