CONFIG DATE/de
(→See also) |
(→Example) |
||
Line 167: | Line 167: | ||
<span style="font-family: Arial;"> </span> | <span style="font-family: Arial;"> </span> | ||
− | = <span class="f_Header"> | + | = <span class="f_Header">Beispiel</span> = |
<br/><source lang="bascomavr"> | <br/><source lang="bascomavr"> | ||
Line 179: | Line 179: | ||
'----------------------------------------------------------------------------------------- | '----------------------------------------------------------------------------------------- | ||
− | $regfile = "m103def.dat" ' | + | $regfile = "m103def.dat" ' Mikrocontroller |
− | $crystal = 4000000 ' | + | $crystal = 4000000 ' Taktfrequenz |
− | $baud = 19200 ' | + | $baud = 19200 ' Baudrate |
$hwstack = 32 ' default use 32 for the hardware stack | $hwstack = 32 ' default use 32 for the hardware stack | ||
$swstack = 10 ' default use 10 for the SW stack | $swstack = 10 ' default use 10 for the SW stack |
Latest revision as of 23:46, 19 March 2013
Contents |
Funktion
Konfiguriert das Format des Datums-Strings für Eingabe und Ausgabe bei BASCOM Datumsfunktionen
Syntax
CONFIG DATE = DMY , Separator = char
Anmerkungen
DMY |
Die Tag-Monat-Jahr-Reihenfolge. Benutzen Sie DMY, MDY oder YMD. |
Char |
Das Zeichen, das als Trennzeichen zwischen Tag, Monat und Jahr benutzt werden soll.
Alte Syntax : / , - oder . (Punkt).
Bevorzugte neue Syntax : MINUS, SLASH oder DOT.
Beispiel: Config Date = DMY, SEPARATOR=MINUS |
Die folgende Tabelle zeigt die gebräuchlichsten Datumsformate und die entsprechenden Befehle.
Country |
Format |
Statement |
American |
mm/dd/yy |
Config Date = MDY, Separator = SLASH |
ANSI |
yy.mm.dd |
Config Date = YMD, Separator = DOT |
Britisch/French |
dd/mm/yy |
Config Date = DMY, Separator = SLASH |
German |
dd.mm.yy |
Config Date = DMY, Separator = DOT |
Italian |
dd-mm-yy |
Config Date = DMY, Separator = MINUS |
Japan/Taiwan |
yy/mm/dd |
Config Date = YMD, Separator = SLASH |
USA |
mm-dd-yy |
Config Date = MDY, Separator = MINUS |
In Holland würde man folgendes nutzen :
CONFIG DATE = DMY, separator = MINUS
Das würde 24-04-02 für den 24. November 2002 ausgeben.
In den USA würde man folgenden benutzen :
CONFIG DATE = MDY , separator = SLASH
Das würde 04/24/02 für den 24.November 2002 ausgeben.
Siehe auch
CONFIG CLOCK , DATE TIME functions , DayOfWeek , DayOfYear , SecOfDay , SecElapsed , SysDay , SysSec , SysSecElapsed , Time , Date
Beispiel
'----------------------------------------------------------------------------------------- 'name : megaclock.bas 'copyright : (c) 1995-2005, MCS Electronics 'purpose : shows the new TIME$ and DATE$ reserved variables 'micro : Mega103 'suited for demo : yes 'commercial addon needed : no '----------------------------------------------------------------------------------------- $regfile = "m103def.dat" ' Mikrocontroller $crystal = 4000000 ' Taktfrequenz $baud = 19200 ' Baudrate $hwstack = 32 ' default use 32 for the hardware stack $swstack = 10 ' default use 10 for the SW stack $framesize = 40 ' default use 40 for the frame space 'With the 8535 and timer2 or the Mega103 and TIMER0 you can 'easily implement a clock by attaching a 32768 Hz xtal to the timer 'And of course some BASCOM code 'This example is written for the STK300 with M103 Enable Interrupts '[configure LCD] $lcd = &HC000 'address for E and RS $lcdrs = &H8000 'address for only E Config Lcd = 20 * 4 'nice display from bg micro Config Lcdbus = 4 'we run it in bus mode and I hooked up only db4-db7 Config Lcdmode = Bus 'tell about the bus mode '[now init the clock] Config Date = Mdy , Separator = SLASH ' ANSI-Format Config Clock = Soft 'this is how simple it is 'The above statement will bind in an ISR so you can not use the TIMER anymore! 'For the M103 in this case it means that TIMER0 can not be used by the user anymore 'assign the date to the reserved date$ 'The format is MM/DD/YY Date$ = "11/11/00" 'assign the time, format in hh:mm:ss military format(24 hours) 'You may not use 1:2:3 !! adding support for this would mean overhead 'But of course you can alter the library routines used Time$ = "02:20:00" '--------------------------------------------------- 'clear the LCD display Cls Do Home 'cursor home Lcd Date$ ; " " ; Time$ 'show the date and time Loop 'The clock routine does use the following internal variables: '_day , _month, _year , _sec, _hour, _min 'These are all bytes. You can assign or use them directly _day = 1 'For the _year variable only the year is stored, not the century End
Languages | English • Deutsch |
---|