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"}) |
||
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: |
"Apr. 26, 12:38:18" |
||
"12: |
"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 |
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}}== |