What is the time now
Username:  
Password:
  > Home
v User Guide
    > Introduction
    v Hello World
       o Authoring program set up
       o Your first BEE Web Page
       o Your first BEE Section
       o Using Variables
       o What is the time now
       o More on conversions
    > Flow Control
    > Function Calls
    > Authentication
    > Database access
    > Content Management
    > Remote Calling
    > Object-Oriented
    > Other Features
> Reference
> Portal Object
> Development Guide


Shortcuts
sys Class
debug Class
Intrinsic Conversions
>> User Guide >> Hello World >> What is the time now <=  =>      <  1  >  
Hello World that tells time

There is a repertoire of useful System Classes that helps you manipulate form, uploading, session, cookies, scheme settings and the file system.  Details can be found in the BEE Script User Reference.

Here we show a trivial example of displaying the system time:

<script language="bee">
var hw = "Hello World";

display "<h1>{hw} </h1> ";

display "The time now is {sys%time}. ";

</script>

 

The output is a ten-digit number (supposing you're doing it after Sep 2001).  To make it readable, we can "convert" it with the Conversion "strftime":

display "The time now is {sys%time|strftime}. ";

 

This will output in a common format like "Sun Dec 15 10:59:05 2002".  You can change it to suit your needs with a printf-like format string.  e.g. {sys%time|strftime:%d/%m/%Y (%a)} shows "15/12/2002 (Sun)".  You can even do this:

display "{sys%time|strftime:The time now is %d/%m/%Y (%a). }";

 

 

Previous Page       Next Page

Accsoft Computer Technology Pty Ltd     ABN: 98 065 617 549
PO Box 892, Epping NSW 1710         Level 1, Epping Office Park, 242 Beecroft Rd, Epping NSW 2121, Australia
Tel: Sydney - (02)98691668     National - 1300-881668         Fax: (02)98691866
© Copyright 2003 Accsoft Computer Technology Pty Ltd