• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 148
  • Last Modified:

Getting Computers Date & Time

Hi,
I was wondering if anyone could help me.
      I want to know how to get the current computer time and date,
in both 24 hr format or showing "AM/PM"


Thanks
Dave Steers
0
dsteers
Asked:
dsteers
1 Solution
 
Éric MoreauSenior .Net ConsultantCommented:
Use the Format function.

? format(time,"hh:nn:ss AMPM")
09:50:33 PM
? format(time,"hh:nn:ss")
21:50:47
0
 
soosairajCommented:
Dear friend you can use  Now() function for both Date And Time .
 if you want only time you can use Time()
   if you want only  date you can use Date() function


Regards..

Raj
0
 
KDivadCommented:
Date, Time and Now are probably what you want, but also take a look at the following functions: Year, Month, Day, Hour, Minute and Second.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
dsteersAuthor Commented:
Thank you everyone,soosairaj,emoreau &
KDavid.
0
 
dsteersAuthor Commented:
Also does anyone know a bit of code that would allow the subtraction of time over midnight.
E.g From 1300 (PM) Thursday 9 March to
 0200 (AM) Friday 10 March.

The Code will tell the difference between the two in days,hours & minutes.

Thanks
Dave Steers
0
 
dsteersAuthor Commented:
DAMM !!
I meant to Give the points to emoreau,
(sorry soosairaj).
My mistake.

emoreau I will post you the points in another question labled
"Points for emoreau"
sorry for this inconvienience.
Thanks
0
 
KDivadCommented:
>>Also does anyone know a bit of code that would allow the subtraction of time over midnight.<<
Take a look at the DateDiff function.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now