MakeInstant from Text doesn't work - Argument to MakeInstant should have a different form - date

I've been playing with MIT AppInventor and attempted to calculate a duration between two dates.
I take date values from two text fields. Clock.MakeInstant says it's only able to accept dates in MM/DD/YYYY format so I was careful to do that. Still, when I attempt to feed them into MakeInstant it always pops the same message about being able to only accept MM/DD/YYYY hh:mm:ss or MM/DD/YYYY or hh:mm. I printed entered text values before passing them to MakeInstant to confirm that they are not somehow corrupted and they are fine -- each just a date in MM/DD/YYYY format.
I have no idea what else to try. As far as I can tell I followed the instructions to the letter. Any examples on how to pass a date as text to Clock.MakeInstant?

see this screenshot source: https://groups.google.com/d/topic/app-inventor-shared-utilities-repository/3bA4wczU9pU/discussion
Taifun

Related

How to set default parameter as 7 days ago to different date format on ssrs

I have default parameter and this parameter shows me 7 days ago with the expression below:
=DateAdd("d",-7,CDate(Format(Today(), "MM/dd/yyyy")))
But my report just running without error while the customer using "MM/dd/yyyy" time format.
Is there a way to use this parameter ALSO with "dd/MM/yyyy" format?
I would like to set a parameter to show 7 days ago but ı would like to use this parameter with both time format.
Thanks
Don't use the Format. Just put =DateAdd("d",-7,Today()). It will automatically take the Format according to System's format.
Firstly, the format part of your expression is redundant and misleading - don't use it
=DateAdd("d",-7,Today())
Secondly, you don't have any choice of how SSRS displays it's datepickers. It shows american format only (M/d/Y)
A date is a value and values do not have a format. A date is displayed and has to be entered in a format that depends on the language settings of your browser. Using a date picker, you even don't have to care about the input format. So, just use an expression that calculates the desired value:
=Today.AddDays(-7)

How to rewrite date in desired format?

Dates comes to me as strings like that '19901226'. But my db waits for '26.12.1990'. How to change it? I know that I need regular expression but never worked with them.
I find it odd that your database expects a non ISO format date, but here goes:
echo date_create_from_format("Ymd","19901226")->format("d.m.Y");
Echos:
26.12.1990
http://sandbox.onlinephpfunctions.com/code/cd0c79eef6fb81a4e55cf314e7e8a9ff7934ada8

Short date style input mask txt showing as plain string in MS Access 2013

I have an text entry control with the input mask 00/00/0000. However it comes into the data table as just a string of numbers, e.g. 05132015. I have the datatype in the schema set to short text with a format of mm/dd/yyyy. Actually, I don't understand the difference between the format (set in the table design mode) and the input mask. Just my ignorance. I don't have a short date data type in the drop down list. In short, I want to have the user enter a short date in the format mm/dd/yyyy and have it show up in the datasheet view with the slashes.
Edit:
I'm having the same problem with running times with an input mask 00:00:00.
Edit:
I found out that I can specify shortened versions of the DateTime datatype. That will do the trick. However, in the short term, is there a way to use an input mask and still have the delimiter come through?

Struggling with dates formats, want YYYY-MM-DD

As an absolute beginner to SAS I quickly ran into problems with date formatting.
I have a dataset containing transaction with three types of dates: BUSDATE, SPOTDATE, MATURITY. Each transaction is represented on two lines, and I want BUSDATE and SPOTDATE from line 1 but MATURITY from line 2.
In the original set, the dates are in YYYY-MM-DD format.
DATA masterdata;
SET sourcedata(rename(BUSDATE=BUSDATE2 SPOTDATE=SPOTDATE2 MATURITY=MATURITY2));
BUSDATE=BUSDATE2;
SPOTDATE=SPOTDATE2;
IF TRANS_TYPE='Swap' THEN;
MATURITY=SPOTDATE;
RUN;
Problem is, this returns something like 17169 (which I guess is the number of days from a certain date).
How can I make it output in YYYY-MM-DD format - or is this approach wrong; should I first convert the date variables to some SAS date format?
if you have valid SAS dates, just add a FORMAT statement to your DATA STEP.
Format busdate spotdate maturity yymmdd10. ;
SAS dates are numeric variables. They represent the number of days since 1/1/1960. You use a FORMAT to display dates.
Adding to CarolinaJay's answer, you normally want to keep them as numeric format, since you can do math (like "# of days since date X") with them. However, if for some reason you need a character variable, you can do this:
date_As_char=put(datevar,YYMMDD10.);
Incidentally, YYMMDD10 will actually give you YYYY-MM-DD, as you asked for; if you want a different separator, see http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000589916.htm (YYMMDDxw. format) - if you put a letter after the last D, for certain letters, you get a different separator. Like, YYMMDDn10. gives you no separator, or YYMMDDs10. gives you slashes. YYMMDDd10. gives you dashes, just like omitting the letter would. This concept also applies to MMDDYY formats, and I think a few others.

Generating OpenXML Excel file doesn't apply date formatting [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Open Xml and Date format in Excel cell
I'm trying to take data from a DataGridView and generate an Excel file with the contents. I have a problem with dates though.
The problem is that, having written the worksheet, saved and opened it in Excel, my date cell has a date value in it and, if I do "Format cells", has the format I requested, yet Excel hasn't applied that format. For example, if I export the date value using ".ToOADate()", I get something like "40690.5270454051" in the cell. If I click into the cell, and then out again, the correct formatting is applied.
I've tried omitting the "ToOADate" call, and the same thing happens (I get a recognisable date value, but only formatted using my custom format after I click in and out of the cell).
I've tried setting the DataType of the OpenXml.Spreadsheet.Cell object to CellValues.Date (or EnumValue(CellValues.Date)) but then I get an error about "unreadable content" when I try and open the xlsx file.
Thanks,
Ross
What you need to do is set a value that is a floating point number (number of days since Jan 1, 1900 or 1904 - there is a setting in the file to decide which). The hh:mm:ss is the fraction part of the number.
You then set the cell format to be the datetime format you want. Excel will then display the number as the formatted date. This is how Excel stores all dates.
What I think is happening in your case is you are setting the value to a string. When you click on the cell, Excel parses the string, sees that it can be turned into a date, and then saves it as the floating point value.
Save the file after clicking and then look at the cell contents to see the difference.