Discussion in 'General Web Coding' started by oshoinfosys, Nov 13, 2008.
I want to get date as input from users in Indian time ( +5.30 )
I am using ASP
I'm assuming that you're using VBscript. Since classic ASP/VB does not support UTC, the best way is to use MSSQL. This first bit will set up a recordset which calls the UTC date and time, adjusted to Mumbai (UTC/GMT + 5.3 hours). Be sure to change the cmd.ActiveConnection value:
Set rsdatetime_cmd = Server.CreateObject ("ADODB.Command")
rsdatetime_cmd.ActiveConnection = your_connection_string
rsdatetime_cmd.CommandText = "SELECT getutcdate() +.229 AS today"
rsdatetime_cmd.Prepared = true
Set rsdatetime = rsdatetime_cmd.Execute
rsdatetime_numRows = 0
You can then use the following in your form:
You can also use this directly in your script which creates the record if you don't want to incorporate it in a form element value. Don't forget to close the recordset at the end of it all:
Set rsdatetime = Nothing
Separate names with a comma.