spot7.org logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories

Convert DD-MM-YYYY to YYYY-MM-DD format using Javascript


You just need to use return newdate:

function calbill()
{
var edate=document.getElementById("edate").value;

var myDate = new Date(edate);
console.log(myDate);
var d = myDate.getDate();
var m =  myDate.getMonth();
m += 1;  
var y = myDate.getFullYear();

    var newdate=(y+ "-" + m + "-" + d);
  return newdate;
}

demo


But I would simply recommend you to use like @Ehsan answered for you.


Categories : Javascript

Related to : Convert DD-MM-YYYY to YYYY-MM-DD format using Javascript
i have to convert the csv file date format to excel date format
You can either modify the format that the data comes to you at the export application or you can transform the date/times after you import that column in as text. There is no magical transformation that Excel uses that can adjust the data as provided. If you were able to get the data with the decimal portions of the seconds in the time prefaced with a decimal point as is the norm and the year was

Categories : Excel
How do I convert NSData to file format (.mp4/.m4a)
I'm guessing [[ANMovie alloc] initWithFile:] expects a file, and you've passed it, I'm also assuming here, an NSData*. Try: ANMovie* file = [[ANMovie alloc] initWithFile:path];

Categories : IOS
not able to convert "£12" nsstring to ascii format
You can't encode a symbol like '£' to ASCII using lossy encoding. That gives the conversion process to drop special characters. (The ASCII character set does not include the '£' symbol. It includes the US "#" symbol instead. back in the day, UK machines displayed that ASCII code as '£' and US machines used "#", but with the advent of Unicode, there are separate characters for both. You should

Categories : Android
Convert following data to JSON format in python
from ast import literal_eval with open('data.txt') as f: sale = [literal_eval(line) for line in f] data = {'Sale': sale} print(data) Output {'Sale': [{'a': 1, 'b': 534}, {'a': 4, 'b': 882}, {'a': 2, 'b': 964}]} From there, you can use the json library to write this to file in JSON format. import json json.dumps(data, indent=4)

Categories : Python
In PHP, how to convert to regular time format from a number
Use the PHP mktime() function. So you would do something like this: $hour = substr($time, 0, -2); // Get everything before last two chars of string $minute = substr($time, -2); // Gets last two chars of string $newtime = mktime($hour, $minute); Then use PHP date() to format it how you want.

Categories : PHP
Recently Add
How to add items to sharepoint list from a html document?
Copying App Package Folder To Isolated Storage For Windows Store App
javascript save file from (sinatra's) streaming response
Use routeParams to create templateUrl in AngularJS
resize image using javascript
How to add and remove div's (input)
Onsen UI sliding menu
BxSlider is working but there is a blank space inside div
on button click delete from datatable and also from array
Jquery changing table th tag is not working properly
Get file height width before uploading using Javascript / Asp.net
Break out of Bootstrap modal dialog if unauthenticated
Listener for click on ANY element and read particular HTML-5 custom attribute when present?
What is the best way to use this in prototype method
Get Latitue and Longitude of the center in google map when draged
Jquery multidimensional Json parse
Not able to format date
How to force y position of one branch in d3 sankey plugin?
radio button doesn't come up from JS file
Calling PHP webservice method from Javascript/jQuery
Responsive menu - parent menu with link
'click' event firing multiple times, no solutions working
How to create Cordova Blackberry (Hybrid) application
Javascript date picker multiple select
How to do the marker management in google map
JQuery/Ajax Unexpected Identifier error
AngularJS Promise error catching
Populate form from child object
Jquery popup with scrollbar and column alignment
OpenLayers3 control panel
© Copyright 2017 spot7.org Publishing Limited. All rights reserved.