Avatar of JimiJ13
JimiJ13
Flag for Philippines asked on

Get Client Time

Hello Experts,

I'm working with VB.Net and I want to get the client DateTimeStamp and populated to the "DTS" textbox everytime and AddPage is opened.
How can I do it using jQuery or JS?  

Many thanks!
jQueryVisual Basic.NET

Avatar of undefined
Last Comment
JimiJ13

8/22/2022 - Mon
Scott Fell

Try below and I have a working sample here http://jsbin.com/UQAHegI/1/edit?html,js,output
var date1 = new Date(); 
var date2=date1.toString();
$('div#result').text(date2);
$('input#time').val(date2);

Open in new window

  <div id="result"></div>
  <input id="time" name="time">

Open in new window

JimiJ13

ASKER
Hi Padas,

Thanks for your quick reply.  
Seems to work with HTML page.  
How can I format the the output as "12/25/2013 9:53 PM" and how to populate with an ASPX TextBox?

Regards,
ASKER CERTIFIED SOLUTION
Scott Fell

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
JimiJ13

ASKER
Thanks for the nice client time. I just made a separate request here for the final part: https://www.experts-exchange.com/questions/28325581/Div-or-Input-into-TextBox.html
Your help has saved me hundreds of hours of internet surfing.
fblack61