How i can change date format in vue.js - date

How i can change date format to be like this : 26-october 22:01:12
Running with Laravel and vue.js
I expect the output 2019-03-26 08:29:23

I suggest you use the library moment.js for that purpose.
import moment from 'moment'
moment('2019-03-26 08:29:23').format('DD-MMMM HH:mm:ss') // outputs 26-March 08:29:23

Related

AnyLogic Date format

Is there a way to change the date format in AnyLogic, without constructing something with the implemented Time functions?
I want my Date to be displayed in such a way
"E dd.MM.yyyy HH:mm"
With the timefunctions I have problems, to get the date into the right format
Not sure what that E stands for, but if it's the timezone, you can get it with this:
ZoneId.of("Europe/Oslo").getDisplayName(TextStyle.SHORT_STANDALONE, Locale.ENGLISH)
I used Europe/Oslo there, but you can find the zone ids that you need here:
https://docs.oracle.com/middleware/12211/wcs/tag-ref/MISC/TimeZones.html
to use this you need to import libraries in Main/Advanced Java/Imports section
import java.time.ZoneId;
import java.time.format.TextStyle;
And then to get the required code with that format:
"E "+String.format("%02d", getDayOfMonth())+"."
+String.format("%02d",getMonth()+1)+"."
+String.format("%04d",getYear())+" "
+String.format("%02d",getHourOfDay())+":"
+String.format("%02d",getMinute())
You can replace the "E " with what I explained before
Or you can use whatever is currently your timezone... AnyLogic uses your computer timezone in order to know what timezone you are in:
Calendar cal=Calendar.getInstance();
cal.setTime(date());
String timezoneCode=cal.getTimeZone().toZoneId().getDisplayName(TextStyle.SHORT_STANDALONE, Locale.ENGLISH);

Matlab - isbusday and busdate format change

Would you be able to advise how can i change the format of the date the functions isbusday and busdate are using ?
The functions use US date format by default, but I need them to be in European format dd/mm/yyyy.
I have attempted to use the code below but it is not working.
isbusday('01-01-2015','dd-mm-yyyy')
busdate('01-01-2015','dd-mm-yyyy',1)
Thank you very much.
You want to convert your string to a datetime object. That is where you can control the format:
d = datetime('01-01-2015','InputFormat','dd-mm-yyyy');
isbusday(d)
busdate(t)
See the documentation: https://www.mathworks.com/help/matlab/ref/datetime.html and https://www.mathworks.com/help/finance/isbusday.html

Can Pandas (or Python) recognize today's date?

I was wondering if Pandas can somehow figure out what today's date is allowing me to automate the naming of the html file I create when I use the "df.to_html" method.
Basically I"m trying to read a website using method "pd.read_html", and then save the dataframe as an html file, daily. The name of the html file will be the day's date. (So today is 9/28/2016 and tomorrow will be 10/01/16 and so on ) I'm not particular about the format of the date, so Sept or 09, whichever is okay.
I'm trying to automate this as much as possible, and so far the best I've gotten is, using ".format" which allows me some flexiblity. But I don't know how I can further automate the process.
import pandas as pd
df = pd.read_html('random site')
today_date = 'saved data/{}.html'.format('Sept 28') # I'm saving it in the folder "saved data" with the name as today's date.html.
df.to_html(today_date)
Thanks.
See the datetime module.
specifically: datetime.date.today().isoformat() gives you a string with the current date in ISO 8601 format (‘YYYY-MM-DD’)

What format is required to import a date into google spreadsheet

With the help of "stackoverflow" and it's users I'm using an app to import data into a Google spreadsheet. The problem is I have a date question on the form, and can not manage to import it. If I change the format (in the forms) to text, the data imports as it has been sent from the app, but when I change it back to date, nothing.
I've believe I've tried all the usual date formats (dd/mm/yyyy, mm/dd/yyyy, yyyy/mm/dd, yyyy/dd/mm) as well as yy for the above and also numerical.
I know that the Google form shows the date in the users format and that is not a problem. It shows up correctly in the spreadsheet in my local format (dd/mm/yyyy).
Does anyone know what format the form uses to send the data to the spreadsheet, or anyway to find out.
Thanks in advance.
Ok, after using wikipedia, and trying every different format it works by using the format yyyy-mm-dd

Custom Date Formatting in J2ME

I would like to format a J2ME Date object to only show the date part, not the date and time. What would be the easiest way? Would probably need to include an external library to do this.
java.util.Calendar has all the methods required to format a date output.