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

automatic display of time

52
hi,

i need to display the current time as soon as a user logs in.
im using this code:

long t1,t2,t3;

Date d=new Date();
t1=d.getHours();
t2=d.getMinutes();

The problem is: for example, if it is 9:30 in the morning,
it displays 9:30
i want it to display: 09:30
how do i do this?
also i want the time displyed in 12-hr format
Apr 23 '07 #1
1 1411
r035198x
13,262 8TB
hi,

i need to display the current time as soon as a user logs in.
im using this code:

long t1,t2,t3;

Date d=new Date();
t1=d.getHours();
t2=d.getMinutes();

The problem is: for example, if it is 9:30 in the morning,
it displays 9:30
i want it to display: 09:30
how do i do this?
also i want the time displyed in 12-hr format
Read about the DateFormat class.
Apr 23 '07 #2

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

Similar topics

4
by: GitarJake | last post by:
Hello all, I am very new to ASP programming. My experience so far is limited to VBA in Windows based apps like Access, Excel etc. Is ASP event driven like Visual Basic? If so, can ASP...
1
by: | last post by:
Hi! Can someone tell me can I use MsBuild with NuNit today? Or is MsBuild only available for MSDN subscriptions ? Or what do you use for an automatic build process + automatic NuNit testing....
3
by: DataBard007 | last post by:
My Access 97 database has a form that contains text boxes that display people's names, addresses, phone numbers, etc. The record source is a single table. I created a NextRecord and Previous...
1
by: Kelly Olsen | last post by:
I have created an automatic update field in my Vendor_Table that automatically updates the date in that field to respond to any changes made to the record. However, I would like to display this...
1
by: Majid | last post by:
H I'd like to notify all active sessions of websit about maintenance tasks at a time How can do this?
1
by: Michel Esber | last post by:
Hello, Linux RedHat AS4 running DB2 V8 FP11. I have followed the docs at http://tinyurl.com/qckrn and enabled automatic statistics collection. It has been 2 days since I updated my DB cfg and...
1
by: wubin_98 | last post by:
Hi, In the first start page, I use JavaScript window.open to open a new IE window that is used to display real-time stock price and refresh each 10 seconds. The problem is when ASP server...
6
by: Ben | last post by:
Hi, In the first start page, I use JavaScript window.open to open a new ASP IE window that is used to display real-time stock price and refresh each 10 seconds. The problem is when ASP...
58
by: Jorge Peixoto de Morais Neto | last post by:
I was reading the code of FFmpeg and it seems that they use malloc just too much. The problems and dangers of malloc are widely known. Malloc also has some overhead (although I don't know what is...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.