Solved

Javascript time based display

Posted on 2011-03-02
1
213 Views
Last Modified: 2012-05-11
Greetings,

I am looking for code or program to display content based on time of day. It will be the same information every date but i need it to show based on the users time.

Any ideas. Thanks.
0
Comment
Question by:sunny-j
1 Comment
 
LVL 11

Accepted Solution

by:
Kusala Wijayasena earned 500 total points
ID: 35015244
You can get client time as follows

var d = new Date();
var hour = d.getHours();
var min = d.getMinutes();
var sec = d.getSeconds();

Open in new window


-Kusala
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now