[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [PROGRAMMERING] Månedden passer ikke



Carl Andersen <sslug@sslug> writes:

> java script. Mit problem er at den ikke viser måneden korrekt. Den
> skulle jo vise December 2003, istedet for står der December 103. Hvad
> er der galt i scriptet.

Ikke noget. Programmøren har bare leget for meget med Perl.

> //  DECLARE AND INITIALIZE VARIABLES
> var Calendar = new Date();
>
> var year = Calendar.getYear();        // Returns year

Du ser ikke ud til at ændre year sener. Så mon ikke getYear returnerer
antal år *efter* år 1900 og at det egentligt kun var meningen at dit
script skulle skrive de sidste to cifre i årstallet ud?

Du kan så enten lægge 1900 til year eller tage year modulo 100. Jeg er
ikke så sikker på javascript-syntax, men mon ikke at % kan bruges som
modulo-operator?

-- 
 Peter Makholm     |       Why does the entertainment industry wants us to
 sslug@sslug |      believe that a society base on full surveillance
 http://hacking.dk |                                               is bad?
                   |                       Do they have something to hide?


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 22:43 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *