473,322 Members | 1,778 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,322 software developers and data experts.

date function working in IE but not working in Mozill firefox3

Hi sir,

I'have written small function in javascript for date (month and year), this is good working in IE at onclick event and current month-8 , year-2008 are displaying but in firefox3,opera,& sufari the current month - 8 and current year- 108 are showing.
I wanna current year in fire fox.

[code goes Here:]

Expand|Select|Wrap|Line Numbers
  1. function validateDate()
  2. {
  3. var d = new Date();
  4. var current_month = d.getMonth()+1;
  5. var current_year = d.getYear();
  6. alert(current_month + current_year);
  7. }
  8.  
Pls help me.

Thanks
Aug 7 '08 #1
3 1639
Use this for the year part

Expand|Select|Wrap|Line Numbers
  1. var current_year = d.getUTCFullYear();

- Hussain
Aug 7 '08 #2
Use this for the year part

Expand|Select|Wrap|Line Numbers
  1. var current_year = d.getUTCFullYear();

- Hussain

Thanks for alot for helping me.
Aug 7 '08 #3
acoder
16,027 Expert Mod 8TB
If Universal Time is not important, then getFullYear() is fine too.
Aug 7 '08 #4

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

Similar topics

7
by: vnl | last post by:
I'm trying to run a SQL query but can't find any records when trying to select a certain date. Here's the sql: SELECT field 1, field2, date_and_time, FROM table1 WHERE date_and_time =...
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...
6
by: Luvin lunch | last post by:
Hi, I'm new to access and am very wary of dates as I have limited experience in their manipulation and I know if they're not done properly things can turn ugly quickly. I would like to use a...
10
by: Daniel | last post by:
In Microsoft Access I can write a query that includes the criteria: Between Date()-7 And Date() to retrieve the records from a table that fall within the last week. I'm trying to write a...
2
bilibytes
by: bilibytes | last post by:
Hi, i have been creating an ajax aplication on my website and it worked as i expected it to work on Safari and Firefox, until i upgraded to Firefox 3. It doesn't work either on windows. the...
6
by: george54 | last post by:
please could advice to get activev x plug in for firefox3
5
by: krishna.tunikipati | last post by:
Hi I have updated my firefox browser from 2.0 to 3.0 My AJAX functionality is not working in firefox3.0 But in firefox2.0 it worked fine. and working fine in all IE versions Plz give me a...
6
by: shivasusan | last post by:
Hi! pls clear my doubt….. some more javascript and vbscript function didn’t support in mozilla firefox. How i can solve that problem? for example: Date(); — didn’t support in firefox.
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.