Javascript help for date.

I am starting to create a website and would like to include
the current date on my site. I searched around on the internet and
came across this code but it doesn't seem to show up when I include
it in the code of the webpage.
<script type="text/javascript">
var d=new Date()
var weekday=new
Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var monthname=new
Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
document.write(weekday[d.getDay()] + " ")
document.write(monthname[d.getMonth()] + " ")
document.write(d.getDate()] + ", ")
document.write(d.getFullYear())
</script>
Is this code incorrect? Or am I not using character spacing
correctly? I have been looking for additional javascript to use but
I thought that I should try this forum for assistance. Any help
would be greatly appreciated. Thanks in advance.

And the URL is:
http://blog.kaosweaver.com/index.php?entry=entry071010-093431
(sorry)
Paul Davis
http://www.kaosweaver.com/
Visit us for dozens of useful Dreamweaver Extensions.
http://www.communitymx.com/
Partner at Community MX - Extend your knowledge
JaneGarner wrote:
> Bregent, I agree that there is better content to have on
a website, but I am
> very new to web design and am trying to learn different
things. I am interested
> in learning the javascript to have the date, but not
sure if I will include it
> when I design my website. And the date would be the date
that the visitor views
> my website, not the current date of the server.
>
> E Michael Brandt, yes the script is all on one line and
it is in the body of
> the page
>
> I did attach the code but this is just a test page to
work with the date.
>
> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
> "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="
http://www.w3.org/1999/xhtml">
> <head>
> <meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
> <title>TestPage</title>
> </head>
>
> <body><script type="text/javascript">
> var d=new Date()
> var weekday=new
>
Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
> var monthname=new
>
Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
> document.write(weekday[d.getDay()] + " ")
> document.write(monthname[d.getMonth()] + " ")
> document.write(d.getDate()] + ", ")
> document.write(d.getFullYear())
> </script>
> </body>
> </html>
>

Similar Messages

  • Search help for date field in Editable ALV

    Hello Friends,
    I am using editable alv using 'reuse_* '.
    I have used date as input field. While creating fieldcatlog also i have  declared dat as a mkpf-budat.
    But i am not getting serach help for date in output.
    Is it possible with reuse or i have to go by object oriented ?

    Hi,
    Just pass the Edit option of the fieldcatalog for those specific fields...
    fcat-edit = 'X'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = sy-cprog
          i_callback_pf_status_set = 'PF_STATUS_SET'
          i_callback_user_command  = 'USER_COMMAND'    "<----  pass this
          i_callback_top_of_page   = 'TOP'
          is_layout                = it_layout
          it_fieldcat              = it_fcat
          i_default                = 'X'
          i_save                   = 'A'
          it_events                = it_event
        TABLES
          t_outtab                 = it_final
        EXCEPTIONS
          program_error            = 1
          OTHERS                   = 2.
    *&      Form  USER_COMMAND
    *       text
    *      -->R_UCOMM      text
    *      -->RS_SELFIELD  text
    FORM user_command USING r_ucomm LIKE sy-ucomm
                            rs_selfield TYPE slis_selfield.
      CASE r_ucomm.
        WHEN '&DATA_SAVE'.                "<-------check this
          PERFORM save_data.
      ENDCASE.
    ENDFORM.                    "USER_COMMAND

  • F4 help for date in select options..

    Hi Gurus,
    I want a search help for date field which belongs to select options.
    I know if it is a parameter we directly map the attribute value to that data element.
    Can some help me with this..
    Best Regards,
    Navin Fernandes.

    Hi Gurus,
    The select options works for date.. I got the solution.
    It directly relates to the default data dcitionary help.
    Got it from this example: WDR_TEST_SELECT_OPTIONS
    Best Regards,
    Navin Fernandes.

  • Search help for date in VC

    Hi, 
    I have created an iview in Visual Composer for a query. it contains date field on selection variable fomr. i tried entering date in various format, but it gives an error : variable expects interval value ; enter an interval".
    can we provide search help for date field in VC?
    Regards,
    Sonali.

    Hi,
    You have to create search help it avoid inconsistency.
    Thanks & Regards,
    Venkat.

  • Search help for DATE field

    HI all,
    I want to attach search help for a DATE field created in screen painter.
    For PERNR, PREM is attached. Similarly what is the statndard search help name for DATE field?
    Thanks,
    Shanthi.

    Hi ,
    Declare the date field as sy-datum ,
    parameters : date type sy-datum .
    This shud bring the standard search help for date .
    Thanks ..Get back for any issues.
    Anil

  • To implement search help for date and time fields details

    how can i implement search help for date and time fields in screen painter

    Hi
    Declare the variables as sy-datum and sy-uzeit or any other pre-defined data typ of date and ime types. Serach help will automatically comes.
    Aditya

  • F1 Help for Data elements

    Hi All,,
    i want to add F1 help for data elements.How can i do this.Kindly suggest me the steps to perform this.

    hi
    use this link
    http://help.sap.com/saphelp_nw04/helpdata/en/a4/d47ee849e111d189730000e8322d00/frameset.htm
    http://help.sap.com/saphelp_nw04s/helpdata/en/45/11e39c459d7201e10000000a155369/frameset.htm
    Cheers
    Snehi
    Edited by: snehi chouhan on Jul 24, 2008 11:10 AM

  • Problems with F4 help for dates

    Hi all.
    In a redesign project we use a new structure for the bsp pages. Since the redesign every F4 help for dates is giving us a java script error.
    Row:      689
    Column: 3
    Error:     'document.all.sapDate.style' is NULL or no object
    Code:    0
    URL:      http://<server>:<port>/wbw(bD1..)/main.do
    In the first version it was a view with some page fragments included containing the F4 helps.
    The new application is a main view containing a changing view over command <bsp:call comp_id="...
    Does the difference in place used matter?
    I also removed the attribute themeRoot from <htmlb:content ...
    Thanks for every hint,
    Timo.

    I have exactly the same problem, someone can tell me how to fix it please ?
    Here is my code for the "date" field :
    CASE p_column_index.
            WHEN 1.
              DATA: tv_col1_inputfield TYPE REF TO cl_htmlb_inputfield.
              CREATE OBJECT tv_col1_inputfield.
              tv_col1_inputfield->id    = p_cell_id.
              tv_col1_inputfield->cellvalue = 'TRUE'.
              tv_col1_inputfield->value = '20000131'.
              tv_col1_inputfield->type = 'DATE'.
              tv_col1_inputfield->showhelp = 'TRUE'.
              tv_col1_inputfield->disabled = 'FALSE'.
              p_replacement_bee      = tv_col1_inputfield.
    Edited by: BB.Fethi on Feb 8, 2010 2:10 PM
    Ok sorry for this post, i haven't see the "remove tag htmlb:page"....
    Edited by: BB.Fethi on Feb 8, 2010 2:13 PM

  • Calendar help for Date i/p field in SRM 5.0 shopping cart

    Hi All,
    I am working on SRM 5.0..I have a requirement for the addition of custom field ie. lease termination date field on SRM shopping cart screen and having a calendar help for this date input field.
    Has anyone tried to add calendar help for an input date field in the ITS service??What all additions have to be done for this(style,images etc)...Does any one has any idea?Please help.
    Thanks & Regards,
    K rav.

    Disha can you please send me these images.
    IMAGES/CALENDAR/ICO12_CALENDAR.GIF
    IMAGES/CALENDAR/LEFT1.GIF
    IMAGES/CALENDAR/LEFT2.GIF
    IMAGES/CALENDAR/RIGHT1.GIF
    IMAGES/CALENDAR/RIGHT2.GIF
    my email id: [email protected]
    and should i store these images in mime repository? Also I have the below code to be attached in template for calendar function give by Zakhar..do you know where exactly in the template do you insert this code? and do you insert it in the standard template itself. My field will appear in shopping cart line item level (CUF field) so what will be the template number??
    <input type=text
              id="`ZAPPSSPR_INCL_ITEM_CSF_AVL-ZZSPR_DKK_DATE.name`"
              name="`ZAPPSSPR_INCL_ITEM_CSF_AVL-ZZSPR_DKK_DATE.name`"
              value="`ZAPPSSPR_INCL_ITEM_CSF_AVL-ZZSPR_DKK_DATE.value`"
              onBlur="BBP_ITS_EXTW_CloseCalendar()" maxlength="10" size="10">
         <a id="a_ZAPPSSPR_INCL_ITEM_CSF_AVL-ZZSPR_DKK_DATE" name="a_ZAPPSSPR_INCL_ITEM_CSF_AVL-ZZSPR_DKK_DATE"
             href="javascript:BBP_ITS_EXTW_OpenCalendarDomRel(window.document.BBPForm.elements['`<b>zappsspr_incl_item_csf_avl-zzspr_dkk_date.name</b>`'], 'a_ZAPPSSPR_INCL_ITEM_CSF_AVL-ZZSPR_DKK_DATE')">
      <img src="/sap/public/bc/its/mimes/bbpglobal/99/images/calendar/ico12_calendar.gif" border="0"></a>
    Thanks,
    Krupa

  • Help for date field not working after upgrade

    hi experts,
    In our BSP application for a page we had an inputfield (date).
    Onvaluehelp for input field we were calling the saphelpdate function.
    however after upgrade this functionality is not working properly as no pop up comes after clicking on the icon.
    we have upgraded to SPS 16 recently.
    please help me.
    regards,
    Arvind.

    Hi, I try upper case but nothing happen. This is all my code by far, I hope you can help me:
    DATA: BEGIN OF T_PCONT OCCURS 0,
          PCONT LIKE ZPSPERMISOS-PSOBKEY,
    END OF T_PCONT.
    DATA: BEGIN OF T_FIELDS OCCURS 0.
            INCLUDE STRUCTURE help_value.
    DATA END OF T_FIELDS.
    DATA: BEGIN OF T_VALUES OCCURS 0,
          VALUE(60) TYPE c.
    DATA: END OF T_VALUES.
    DATA: N TYPE i.
    SELECTION-SCREEN BEGIN OF BLOCK  b20 WITH FRAME TITLE text-b02.
      SELECT-OPTIONS:
        P_CONT FOR  ZPSPERMISOSH-PSOBKEY OBLIGATORY NO-EXTENSION NO INTERVALS,
        P_INT  FOR  ZPSPERMISOSH-PARTNER OBLIGATORY NO-EXTENSION NO INTERVALS,
        P_FEC  FOR  ZPSPERMISOSH-ZFINICN NO-EXTENSION NO INTERVALS,    
        P_RAZ  FOR  ZPSPERMISOSH-ZRAZONFINIC NO-EXTENSION NO INTERVALS.
    SELECTION-SCREEN END OF BLOCK b20.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_CONT-LOW.
      PERFORM P_HELP_P_CONT USING P_CONT-LOW.
    *&      Form  P_HELP_P_CONT
    FORM P_HELP_P_CONT  USING P_P_CONT.
      DESCRIBE TABLE T_PCONT LINES N.
      IF N EQ 0.
        T_FIELDS-FIELDNAME  = 'PSOBKEY'.
        T_FIELDS-TABNAME    = 'ZPSPERMISOS'.
        T_FIELDS-SELECTFLAG = 'X'.
        APPEND T_FIELDS.
        CLEAR T_FIELDS.
        SELECT PSOBKEY FROM ZPSPERMISOS
        INTO  TABLE T_PCONT.
        SORT T_PCONT BY PCONT.
      CALL FUNCTION 'HELP_VALUES_GET_WITH_TABLE'
        EXPORTING
          CUCOL        = 10
          CUROW        = 1
          TABNAME      = 'T_PCONT'
          FIELDNAME    = 'PCONT'
        IMPORTING
          SELECT_VALUE = P_P_CONT
        TABLES
          FIELDS       = T_FIELDS
          VALUETAB     = T_VALUES.
    ENDFORM.                    " P_HELP_P_CONT
    Edited by: J. Garibaldi on Nov 25, 2009 11:14 AM
    Edited by: J. Garibaldi on Nov 25, 2009 11:16 AM

  • Help for date compare in sqlite?

    Hi all,
          How to decide a date is between two date or not? for example, I want to query the tasks in the next week from the sqlite db, how to do?
            SELECT  * FROM TASK_TD WHERE TASK_DATE > NOW AND TASK_DATE < NEXTWEEK_DATE
        That does not work!
       Anybody can help me?Thanks a lot.
    David

    If you're using ActionScript (Flex or Flash) for your database, you could also declare your columns as "Date" (i.e. the ActionScript Date class). AIR has added support for Date as a recognized data type in its SQLite implementation:
    http://livedocs.adobe.com/flex/3/langref/localDatabaseSQLSupport.html#columnAffinity
    http://livedocs.adobe.com/flex/3/langref/localDatabaseSQLSupport.html#additionalSQL
    By using statement parameters to pass in Date data the ActionScript Date objects are converted when you insert data, and when you retrieve data it automatically comes back as ActionScript Date objects.
    Internally in the database, the Date values are stored as SQLite REAL (Unix epoch format) so date comparisons should work fine. For instance, if you want to find all rows with a date in a certain range, you could use this SQL:
    SELECT *
    FROM mytable
    WHERE datecolumn BETWEEN :startdate AND :enddate
    Then you'd need to specify the :startdate and :enddate values as parameters:
    sqlStatement.parameters[":startdate"] = new Date(2000, 3, 15);
    sqlStatement.parameters[":enddate"] = new Date(2005, 6, 13);
    2. Add a custom SQLite function for this purpose (see more about it in http://sqlite.org/cintro.html under 'Extending SQLite' section). Note that in such case you'll suffer slow performance if you have large tables (since dates are not indexed correctly).
    Unfortunately AIR doesn't support custom functions in SQLite.

  • F4 help for Date field and Validation

    Hi Friends,
    I am new to BSP programming .I knew getting F4 help in normal ABAP.But i don't know in BSP .
    I want simple steps to get F4 for a field on Page as well as date field .
    and How to valid those entered dates.
    Presently i am using length 10 character variable for DATE without F4 help and No validation.
    I think you guys will help me out.
    Thanks,
    Venkat.O

    Welcome to SDN.
    for F4 help with validation for dates you can use the following code.
    <htmlb:inputField id         = "wf_ad_date"
                                    type       = "date"
                                    showHelp   = "TRUE"
                                    value = "<%= sy-datum  %>"
                                    visible    = "true"
                                    disabled   = "false"
                                    required   = "true"
                                    maxlength  = "10"
                                    size       = "10"
                                    doValidate = "true"
                                    design     = "standard" />
    For other type of fields check out this weblog by Thomas Jung
    <a href="/people/thomas.jung3/blog/2005/08/22/bsp-value-input-help-popups-version-30 Value Input Help Popups Version 3.0</a>
    Regards
    Raja

  • F4 help for date field in ITS

    hi all;
    I was working on ESS Leave Request, i am using the standard program SAPMWS20000081H and the service template WS20000081.
    Now in the EP view i am unable to get the F4 help for the date field 'Absence From' & 'Absence To'. i have checked the data element used it is 'DATS'.
    How to get the F4 help in the view, please help me its of high priority.

    Hi, I can tell you what we have done.  I can see that the original template displays the "Absence from" field this way :
    <tr>     <td>`SAP_TemplateEditableField("FromDay", fieldLabel=ABSENCEFROM030150.label, fieldLabelWidth="170", name="ABSENCEFROM030150", value=ABSENCEFROM030150, size="10", maxlength="10", marginTop=9, inspectionText=ABSENCEFROMDAY,  align="",
    required="", width="", onchange="update_checkn(this.SAP_value, this)" )` </td>
         </tr>
    We modified the template to display it like this :
    <tr><td> `SAP_Field("ABSENCEFROM030150","ABSENCEFROM030150", DynproLabelWidth="170")` </td></tr>
    We did the same for ABSENCETO040150. So you can play around with the template to generate the F4 button. ( Note that we also added the ~webgui parameter in the service file and set it to 1, this in order to generate the calendar ). Good luck !

  • Search help for date in module pool

    Hi experts
                      i am developing a module pool prog, in the second screen 6 fields are displayed and one of them is date field. I wanna search help for that date field. Plz note the date field is populated from Work area of iternal table.
    Plz help me out in solving the issue.
    Thanks and Regards,
    Alson

    Hi
    We have a lot of Example programs in SAP, have a look at the demo program
    <b>DEMO_DYNPRO_F4_HELP_MODULE</b>..
    http://help.sap.com/saphelp_nw04/helpdata/en/9f/dbaac935c111d1829f0000e829fbfe/content.htm
    Regards
    Sudheer

  • Search help for date in ALV grid

    I have ALV grid with field type date and search help for this:
    ws_field-ref_table = 'ADCP'.
    ws_field-ref_field = 'DATE_FROM'.
    ws_field-inttype = 'D'
    After I have clicked on this key F4 then I see a calendar and I have choosen some date, but in input grid field there aren't
    choosen value. Why? Another search helps works perfect except this. Where is the problem?
    Edited by: Kosmo on Jul 7, 2009 8:48 AM

    Hi,
    Find the code below
    TYPE-POOLS: slis.
    DATA: it_fcat TYPE slis_t_fieldcat_alv,
          wa_fcat LIKE LINE OF it_fcat.
    DATA: it_data TYPE vbap_t.
    SELECT *
      FROM VBAP
      INTO TABLE it_data
      UP TO 20 ROWS.
    wa_fcat-fieldname = 'VBELN'.
    wa_fcat-tabname  = 'IT_DATA'.
    wa_fcat-ref_fieldname = 'VBELN'.
    wa_fcat-ref_tabname = 'VBAK'.
    APPEND wa_fcat TO it_fcat.
    clear wa_fcat .
    wa_fcat-fieldname = 'POSNR'.
    wa_fcat-tabname  = 'IT_DATA'.
    wa_fcat-seltext_l = 'Date'.
    wa_fcat-ref_fieldname = 'ERDAT'.
    wa_fcat-ref_tabname = 'VBAK'.
    APPEND wa_fcat TO it_fcat.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_interface_check       = sy-repid
          it_fieldcat             = it_fcat
        TABLES
          t_outtab                = it_data
        EXCEPTIONS
          program_error           = 1.
    I have derived the above code from WIKi link
    https://wiki.sdn.sap.com/wiki/display/Snippets/f4helpforalvgrid+display
    Regards,
    Murthy.

Maybe you are looking for