Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4043434
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T13:07:35+00:00 2026-05-20T13:07:35+00:00

I have build this function: function currentDate() { var date; var currentDate = new

  • 0

I have build this function:

function currentDate() {
    var date;
    var currentDate = new Date();
    var day = currentDate.getDate();
    var month = currentDate.getMonth() + 1;
    var year = currentDate.getFullYear();

    // if the month length = 1 add "0" to ir
    if (currentDate.getMonth().toString().length == 1) {
        month.toString();
        month = "0" + month;
    }

    // if the day length = 1 add "0" to ir  
    if (currentDate.getDate().toString().length == 1) {
        day.toString();
        day = "0" + day;
    }

    var ISO = year + "-" + month + "-" + day;
    var EUR = day + "/" + month + "/" + year;

    return date = {
        "ISO": ISO,
        "EUR": EUR
    };
}

When I click on a button I want the ISO date or the EUR date to be passed into a text input. How can this be done???

Thank you..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T13:07:35+00:00Added an answer on May 20, 2026 at 1:07 pm

    When defining an object the key does not need to be in quotes.

    <input id="cdate" />
    <input type="button" onclick="$('#cdate').val(currentDate().ISO)" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code: MyObject = function(){ this.field = null; this.build = function(){ var
this is so that I will have to build a delete function, I try
I have a function that looks exactly like this: function exportSelectedToExcel(id) { var selectedRows
I'm trying to build this layout: I have this at this time: http://jsfiddle.net/Gh6mB/12/ The
I have build a c# class library verification.dll using OpenCVSharp. This references OpenCvSharp.dll in
I have a doubt, I made this build file in order to build 3
I have this nice little MSBuild-based daily build setup that I use on my
I have read this in order to compile NH spatial for Nhibernate 3.1 http://build-failed.blogspot.it/2012/02/nhibernate-spatial-part-2.html
I have taken over a project that was build from suggestions in this Dan
I have a jQuery menu which is build up by like this: <h3 id='300'

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.