Date format: Difference between revisions
Add ed example
Langurmonkey (talk | contribs) |
(Add ed example) |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 1,705:
me_msg()_now()_format(yyyy-mm-dd);
me_msg()_now()_format(eeee, mmmm dd, yyyy);</syntaxhighlight>
=={{header|Ed}}==
Using <tt>date</tt> is cheating, but ed has no built-in date fetching/formatting. Most other languages use strftime, which is basically the same thing, anyway.
<syntaxhighlight lang="sed">
H
!date +"\%Y-\%m-\%d"
!date +"\%A, \%B \%d, \%Y"
Q
</syntaxhighlight>
=={{header|EGL}}==
Line 2,314 ⟶ 2,325:
=={{header|langur}}==
<syntaxhighlight lang="langur">
</syntaxhighlight>
<syntaxhighlight lang="langur">
writeln
writeln
</syntaxhighlight>
▲writeln toString dt//, "Monday, January 2, 2006"</syntaxhighlight>
{{out}}
<pre>2020-03-26
Thursday, March 26, 2020</pre>
=={{header|Lasso}}==
Line 2,797 ⟶ 2,790:
<pre>2010-07-30
Friday, July 30, 2010</pre>
=={{header|PascalABC.NET}}==
<syntaxhighlight lang="delphi">
begin
var today := DateTime.Now;
Println(today.ToString('yyyy-MM-dd'));
Println($'{today:D}');
end.
</syntaxhighlight>
{{out}}
<pre>
2024-06-01
Saturday, June 1, 2024
</pre>
=={{header|Perl}}==
|