1. If i need to add into the database time now() of singapore time, how do i do it??
now() + ______
2. If I need to output the time now of singapore , how??
<cfoutput>#now() + __________#</cfoutput>
As I said, it should be a string: - <cfoutput>#DATEADD("h", 8, utcDate)#</cfoutput>
11 3958 acoder 16,027
Recognized Expert Moderator MVP
Is this for anywhere throughout the world? You only want to output Singapore time, not the local time?
Yes for sigapore time only
because I want to set now() Singapore time to add to the database
<cfset form.aaDate='#now()#'>
where aaDate is always the singapore time.
thanks
acoder 16,027
Recognized Expert Moderator MVP
Try the DateConvert() function. If the local computer is Singapore time, then that should be OK. If not, you'll have to convert it. TimeZoneInfo() may help too.
The server is a US server
so time now is not accurate
<cfset curDate = Now()>
<cfset utcDate = DateConvert("local2utc+8", curDate)>
How do I add +8 hours to the UTC time??
acoder 16,027
Recognized Expert Moderator MVP
You could try converting the locale using setLocale(). If that doesn't give the desired result, then for want of a better solution, try DateAdd with the number of hours from UTC.
sorry to ask
but is the statement as follow correct?? - <cfset curDate = Now()>
-
<cfset utcDate = DateConvert("local2utc", curDate)>
-
<cfoutput>#DATEADD(hh, 8, utcDate)#</cfoutput>
acoder 16,027
Recognized Expert Moderator MVP
The first parameter should be a string and it's "h", not "hh".
I get an error
ts '2008-10-08 09:36:18'} {ts '2008-10-08 16:36:18'}
The web site you are accessing has experienced an unexpected error.
Please contact the website administrator.
The following information is meant for the website developer for debugging purposes.
Error Occurred While Processing Request
Variable H is undefined.
Resources:
acoder 16,027
Recognized Expert Moderator MVP
As I said, it should be a string: - <cfoutput>#DATEADD("h", 8, utcDate)#</cfoutput>
Ok, done, thanks.
A LOT !!
CHEERS! ;-)))))))))))))
acoder 16,027
Recognized Expert Moderator MVP
You're welcome. Glad it's working :)
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Simon Gare |
last post by:
Hi
I need to Flash dynamic text on ASP page if the time in the record is less
than 20 minutes from NOW() time.
Thanks in advance
Simon
|
by: luscus |
last post by:
Thanks for all the responses on my first question. Unfortunately the
answers I was given were too complicated for my small brain , and
neophite condition to understand. So if you could talk down to...
|
by: Tim Quon |
last post by:
Hi
I need to print the current time.
I found an example where this is done as followed:
long *mytime;
time(mytime);
printf("time: %s", ascitime(mytime);
But this doesn't work and prints...
|
by: Wei Jones |
last post by:
Hi, all
I got a problem as subject title. I create a pthread which like :
static time_t *Now;
void get_time(void *tmp)
{
while(1) {
time(&Now);
disp_time_somewhere();
sleep(1);
|
by: Suresh |
last post by:
hello,
i am new to c and how do i use time function to get time.
thanks,
Sean
|
by: Asad |
last post by:
Hi,
I was wondering how I can find out the time user takes on an aspx page
before hitting a submit button. Since there is that whole server-side
vs. client-side issue, I was thinking I can store...
|
by: Max |
last post by:
This is a follow-up on my previous thread concerning having the program
wait for a certain date and time and then executing some code when it
gets there. My question is; can I use the Sleep...
|
by: Gary Wessle |
last post by:
Hi
could someone please tell us how to do this:
my PC time is set to Australia/Sydney.
I need New York time epoch using libboost_date_time
thank you
#include <iostream>
|
by: idealfellow |
last post by:
I am using the following to get the time:
puts Time.now --> starting of my script
<MY CODE>
puts Time.now --> end of my script
I want to get the Time difference between two Time.now...
|
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: 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...
|
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,...
|
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...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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...
|
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...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |