[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

Re: Date ?

On Tuesday 4 May 1999, at 10 h 55, the keyboard of Frederic Le Mouel 
<Frederic.LeMouel@irisa.fr> wrote:

> Is-it possible to catch the date ?
> No <date> tag ?

WML (and it is one of its main strengths) is extensible.

<define-tag date>
print &time2string_fr(time());

sub time2string_fr {
        my ($time, $display_day) = @_;
        my ($result);
        my ($week_day_text);
        my ($seconds, $minutes, $hours, $days, $month, 
            $year, $week_day, $year_day, $is_dst) = 
                gmtime ($time);
        $month_text = ("Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet",
                "Août", "Septembre", "Octobre", "Novembre", "Décembre")
        if ($display_day) {
          $week_day_text = (Dimanche, Lundi, Mardi, Mercredi, Jeudi, 
                Vendredi, Samedi) [$week_day];
        $year = $year + 1900;

        $result = "$week_day_text $days $month_text $year";

        return $result;


Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com