Web scraping: Difference between revisions

Content added Content deleted
Line 1,489: Line 1,489:
if string(res) then
if string(res) then
timedate td = parse_date_string(res, {"Mmm. d, hh:mm:ss"})
timedate td = parse_date_string(res, {"Mmm. d, hh:mm:ss"})
?format_timedate(td,"h:mpm Mmmm ddth")
td[DT_YEAR] = date()[DT_YEAR]
?format_timedate(td,"h:mpm Dddd Mmmm ddth")
?format_timedate(date(),"h:mpm Dddd Mmmm ddth")
end if
end if
else
else
Line 1,498: Line 1,500:
{{out}}
{{out}}
<pre>
<pre>
"Apr. 26, 12:24:11"
"Apr. 26, 12:38:18"
"12:24pm April 26th"
"12:38pm Friday April 26th"
"1:38pm Friday April 26th"
</pre>
</pre>
The last line differs because it is British Summer Time here.<br>
Note that since that webpage has no year, td[DT_YEAR] will be 0 (you could of course just set it from date()[DT_YEAR]), and hence the weekday would also be wrong.
Note that since that webpage has no year, td[DT_YEAR] will be 0, and without setting it as shown the weekday would also be wrong.


=={{header|PHP}}==
=={{header|PHP}}==