Specifiy date type used by fullcalendar - fullcalendar

The date/time format fullcalendar uses is kind of weird. I want to specify during the created of the calendar or somewhere in the parameters a datetime of MM/DD/YYYY HH:MM PM/AM. Is there a way I can do this. I read about formatdate, but didn't get any information about this

fullCalendar has "parseDate" and offers three methods:
The string may be in ISO8601 format, IETF format, or a UNIX timestamp (in either integer or string form).
Your "MM/DD/YYYY HH:MM PM/AM" seems not to match one of them.

Related

Marketo - REST API datetime field is wrong

I sent the following string to Marketo REST API to be set as the value of a datetime field:
"2010-05-07T15:41:32"
But Marketo displays it as:
May 6, 2010 8:00 PM
Is there something i'm missing?
It is always a bit tricky to deal with DateTime properly.
Most probably there are two, but related issues here:
The format of the datetime string you are using is not exactly the format that Marketo expects.
You are living in a timezone that is different to the internal timezone Marketo uses.
Luckily, you can easily overcome this issue.
The exact format for the datetime string should follow the ISO 8601 standard, as it is described in the Field Types section of the documentation. An important part of that specification is the timezone offset, which follows the “normal” datetime part as the difference to Greenwich time in the form of ±hh:mm. So, depending on your timezone, your date string should look like somthing like this: 2017-05-08T08:08:08+02:00. (Where +02:00 is for Central Europe.)
In case you are using PHP, the easiest way to have this format is by using the c full Date/Time format, like so:
$date = new DateTime('2010-05-07 15:41:32', new DateTimeZone('Europe/Budapest'));
$dateString = $date->format('c');
var_dump($dateString);
// outputs: '2017-05-08T08:08:08+02:00'

Date format in lotus notes

I have a lotus notes field which should save the date/time in the GMT format,
for that I used
Dim timenow As Variant
timenow = Now()
Dim dateTime As New NotesDateTime( timenow )
doc.abc = dateTime.GMTTime
This will set the field 'abc' to have the date and time in GMT. But now I am having issues with the date format. In my system it saves it in the format 10/28/2016, but for other users whose system date format is different, it saves it in the format 28.10.2016. I need to force the date format to be 10/28/2016, I tried used format function
doc.abc = Format(dateTime.GMTTime, "m/d/yy h:nn")
The above code gives the date and time in GMT, but doesn't change the date format.
You are wrong in the assumption, that the date is SAVED in that format.
Date items in the backend are number- items. They store the date as number, the integer part is the day, the fraction part is the time of the day (day 0 is 12/31/1899 00:00)
Then the setting in the client determins, how the client displays the date.
In the properties of the item you usually define "Client" as display format, but you could fix the display of the date to a specific form.
But usually this is NOT necessary, and every german will not like the "reversed" order of english / american time formatting.
This will only be a problem, if you construct a text from that date, as #Text() will convert it using the clients format.
I guess, that your problem is not in the "saving" of the item, but somewhere else in your code, where you interpret the date as text, and this is always a problem.
What type of field is it? If it's a date field, the Notes client will use the user's local date format.
If you want to use a specific format, you can use a text field instead, but of course then the time won't adjust to the user's local time zone.
The way to get the best of both worlds is to store the date in date field, but use a computed-for-display field to show it in the user's current timezone, but in exactly the format that you want.
Most people use a NotesDateTime object to set the date in a field
Dim ExpiryDate As New NotesDateTime(Cstr(Today))
Even if the field in the form uses a specific format, the date like 2019-09-08 can mean 8th september 2019 or 9th august 2019 depending of the LocalDate setting
To avoid this behavior, you need to force the format in your NotesDateTime Object
Like this
Dim ExpiryDate As New NotesDateTime(Format$( Today, "yyyy-mm-dd "))

Convert RFC date to short date mm/dd/yyyy

I need to convert an RFC 822 formatted date into the short date format of mm/dd/yyyy using VB.net. I have a web application that I cannot change the source code for. The web application allows an RSS feed to be sorted by month and year.
Would appreciate any advice or assistance.
Use Date.TryParse to convert the string to a Date value, then use Date.ToString with a custom format string to set the format the way you want it.

How can I get an ISO date (not localized) from a PloneFormGen results template?

How do I get an ISO date (2010-01-01 00:00:00), in addition to the localized date, in a PloneFormGen mailer template?
Do you want this for the current date/time, or for a date/time submitted via the form?
Regardless, if you have a Zope DateTime instance, you can get an ISO representation like this:
>>> mydate.ISO()
If you want it in UTC, it's easy to convert it:
>>> mydate.toZone('UTC').ISO()

How to trim datetime string to its minute in GridView?

I have bound fields in GridView to some dateTime property of data objects. The fields are displayed to the seconds level. It looks like 2009-2-3 18:00:00 PM.
I just want it displayed to the minutes, e.g 2009-2-3 18:00.
What is the best way to do this?
Edit:
I find use DataFormatString="{0:g}" is fine for me.
The format is 2009-2-3 6:00 PM.
Although you have found a solution, here's some additional information:
You can find a list of all standard date and time format strings (such as "g") on this page in MSDN: Standard DateTime Format Strings.
And if do not want to use one of the predefined formats, there is also a page about Custom Date and Time Format Strings. For example, to get a date exactly in the format you used in your question ("2009-2-3 18:00") you could use the format string "yyyy-M-d HH:mm".
Before using a custom format string, remember that using the standard (predefined) format strings has the advantage that it automatically takes into account the current culture (regional settings). So if you want to display the date to users, probably a predefined format will be the better choice.

Resources