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

Time & Date Combo JavaScript

I am trying to combine a JavaScript that will change a selected text based on a actual date and time of day of that date...

Example::

Jan. 6, 2012 @ 8:00am the text would read "Clue #1 - It's Hot & Cold"
Jan. 6, 2012 @ 12:00pm the text would read "Clue #2 - It's Wet & Dry"
Jan. 7, 2012 @ 1:00am the text would read "Clue #3 - It can not be eaten"
Jan. 8, 2012 @ 4:00am the text would read "Clue #4 - It can change in just a minutes time"

Is it possible to write a COMBO code that will do both?
Jan 4 '12 #1
3 2366
Rabbit
12,516 Expert Mod 8TB
Do both what? I only see one thing. Do you mean get the date and time? You can use the getTime() function which will return the number of milliseconds from midnight Jan 1, 1970.
Jan 4 '12 #2
Sorry but you totally went out into left field with your answer..

I am wanting to COMBINE 2 scripts into 1.. One that will grab the date (Jan. 01, 2012) and the Time (7:30 am) and pull information from a flat file database. to produce a result... See EXAMPLE and read it clearly...

The Script will detect that today is Jan. 01, 2012 and it is currently 7:30am so it will write the following text (display) Good Morning You must not has stayed out too late for new years eve last night...

THEN

someone else visits the site at 8:30pm so the script will post (display) Good Evening, Hope your New Years Day has been a productive one...

the flat file database will have such info as this to be displayed

EXAMPLE

01-01-2012 - 2:00am - Good Morning and Happy New Years to you....
01-01-2012 - 7:30am - Good Morning You must not has stayed out too late for new years eve last night...
Jan 11 '12 #3
Rabbit
12,516 Expert Mod 8TB
I still don't understand what the problem is. To combine two scripts, you just copy and paste one into the other.
Jan 11 '12 #4

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

Similar topics

2
by: Oliver Spiesshofer | last post by:
Is there a script available that would re-format a time & date always according to the users' setting? Some setting that would be read by the language set in the browser or from the IP? ...
1
by: Sara Khalatbari | last post by:
Is there a Module in Python that gives you the time & date of today??? __________________________________ Do you Yahoo!? Make Yahoo! your home page http://www.yahoo.com/r/hs
2
by: Vince C. | last post by:
Hi all. I'm trying to set a cookie expiry date but my script is JS (JavaScript). I've tried Response.Cookies("Test").Expires = Date(); Response.Cookies("Test").Expires =...
1
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I format Last Modified date with javascript...
1
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I format the Last-Modified date with javascript?...
5
by: patelxxx | last post by:
However not using document.write!! Cheers
1
by: Vinnie | last post by:
I'm using this code to get the time and the current date, but i get and error: System.Globalization.CultureInfo culture = new System.Globalization.CultureInfo();...
2
by: newbguy7040 | last post by:
I made a clock on my HTML document, and tried to make it show the current date. After I loaded the page, it worked fine. However, after typing more code and testing things completely separate from...
7
gskoli
by: gskoli | last post by:
I have created a gif based digital clock but problem is that it will show me the client side time . I am a perl developer so i am getting server time, i mean , i can fetch that time , to pass the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...

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.