selenium-google-code-issue-archive
selenium-google-code-issue-archive copied to clipboard
Getting a date in the format "2014-08-26T17:49:09.000Z" from a WebElement property Text
Originally reported on Google Code with ID 8346
Getting the Text property of an element that contains a date in the format: "2014-08-26T17:49:09.000Z"
returns the date in a different format: "8:26:2014 5:49:09 PM"
For example:
html contains: <dev id="date1">2014-08-26T17:49:09.000Z</dev>
command: string date1 = driver.FindElement(By.Id("date1")).Text;
date1 will be "8:26:2014 5:49:09 PM" and not "2014-08-26T17:49:09.000Z"
Selenium version: 2.44 using C#
OS: Windows 7
Browser: Chrome
Browser version: 35
ChromeDriver version: 2.10
html page for test:
<html>
<head>
</head>
<body>
<div id="date1">"2014-08-26T17:49:09.000Z"</div>
<div id="date2">"26/08/2014 17:49:09"</div>
<div id="date3">"2014-08-26"</div>
<div id="date4">"2014-08-26 17:49:09"</div>
</body>
</html>
Reported by meirblachman
on 2014-12-30 17:11:50
Reported by barancev
on 2015-01-17 23:32:57
- Labels added: Lang-CSharp
Reported by luke.semerau
on 2015-09-17 17:47:30
- Labels added: Restrict-AddIssueComment-Commit