LibreOffice : how shall I change the names of the weekdays in date format - date

In LibreOffice, I wish to change the weekdays names to have something shorter.
In French, the date format "ddd dd/mm/yy" applied to today 2021-08-17 gives : "mar. 17/08/21". I would prefer "ma 17/08/21" to have narrower columns.
So I wish to change the existing weekdays names "lun., mar., mer., jeu., even., sam., dim." to something shorter : "lu, ma, me, je, ve, sa, di", through the format used by LibreOffice.
I played with French locales (Swiss French, etc.) but it is not satisfactory. I tried to change the list for the sort but it has no effect on the date format.
Is it possible to change the list LibreOffice uses for the weekdays ? How shall I proceed ?

You cannot do this with normal formatting (unless you require a change to the national date standard).
However, you can easily get the desired date representation using the TEXTE() and REGEX() functions.
=REGEX(TEXT(A1;"OOO JJ/MM/AA");"(..)([^\.]*\.)(.+)";"$1$3";"g")
Or shorter notation using LEFT() (GAUCHE()):
=LEFT(TEXT(A1;"OOO");2)&TEXT(A1;"\ JJ/MM/AA")
Remember to check that the cell format is French, otherwise you will get an error (not every language uses O-J-A characters)

Related

NSDataDetection for Dates in Images with different Formats dependent of Locale?

I would like to convert a Date on an image to a Date type in Swift to store that data. I thought that I could use NSDataDetector for doing this, because I don't know the exact format which will occur on the image.
I had for example this Date: 01.08.2022 with the format: dd.mm.yyyy but if I use the NSDataDetector it was interpreted with the format mm.dd.yyyy
Is it possible to change that behavior so that the usual order of the numbers for the days and months for the region is used for interpretation?
Thanks for an answer

Qt5: date format MMM, in Spanish, remove point

In Qt5, the MMM format, which displays the month name in a short format (e.g., "Dec" instead of "12" or "December"), when using it for the Spanish locale, shows the abbreviated month name with a dot at the end, for example, for, "25th December 2016", in MMM/dd/yyyy format, shows "Dic./25/2016".
The problem is when editing. For displaying a date, it's ok, since it's what the Spanish rules say, but it isn't suitable for editing. I'm forced to position the cursor just after the point, at the end of the month part, to delete the point, and then, the rest of the month name. If I try to put the cursor just before the point, to edit just the month name part, the field is in "read-only" mode. I can't not remove anything, unless I remove everything from the very right of the line and back, character to character (or just selecting the whole month part and remove everything).
Besides, the point is not autocompleted. So, if the user writes the new month forgetting the dot, the edition is rejected and fall backs to the original value.
Taking all of it into account, editing a QDateEdit is a bit cumbersome (in Spanish).
I don't know if it is the built-in QDateEdit behaviour, or internally it is using a QRegExpValidator, but in that case, I don't know what it's the regexp expression, to personalize it from it.
In short, how can I "solved" it? (the cumbersome edition; it's ok for me both, removing the dot, or changing the validation).
The Qt 5 behavior is correct and there's nothing Qt can do (or should do). The only correct and acceptable short name of December in a es_ES locale is "dic.", trailing dot included. That's what CLDR says:
http://www.unicode.org/cldr/charts/30/summary/es.html#1636
http://www.unicode.org/cldr/charts/30/verify/dates/es.html

Changing the Access date format

In an Access form, I need to use the date output from a date picker field to be used to search for a file in a form. However, the default data format seems to only allow slashes. Although I know the date is being stored as a number in the database.
Put simply, I need Me.myDate to output a legal file name structure, for example, yy-mm-dd. Then I can concatenate that with my file name to search for myfilename_yy-mm-dd
I always get myfilename_yy/mm/dd which is of course unusable as a file name.
Changing the format of the field obviously makes no difference to how the value is stored. What I don't understand is if the date is stored as a number, and the output is shown in the selected format, how I can override the default formatting behaviour used when I query the date.
The Format Function will allow you to format the date as you wish.
An expression to include the formatted date in a filename pattern could look like this ...
"myfilename_" & Format(Me.myDate, "yy-mm-dd") & "*"

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.

crystal reports - how to extract a date from string

Using Crystal Reports 2008, I need to extract a date from a text field. This date is usually in the format dd/mm/yy, but could also be entered as d/m/yy, dd/m/yyyy, etc.
This date could appear anywhere within the string.
At the moment I am relying on the fact that the date is placed at the end of the string, without a following fullstop, and using LEFT/RIGHT to extract each date part. These parts are then passed to another formula to create a full date:
Dim AllocationDate() as Date
If Not(IsNull({Command.Notes})) then
Formula = DateValue ((ToNumber ({#Year})), (ToNumber ({#Month})), (ToNumber ({#Day})))
However, if anyone uses a variation of format, adds a fullstop or more notes after the date the whole report keels over.
Is there any way I could extract this date by looking for a pattern? I'm guessing I could the use TRIM to get around the inconsistencies in format.
tyvmia
You may want to consider using a regular expression.
Crystal Reports doesn't have native support for regular expressions, so you'll need to add a UFL: crystal reports : is there a way to regex in crystal reports?
You should be able to adapt the pattern in this question for your needs: Javascript date regex DD/MM/YYYY
Finally, you can test the pattern on your text using regexpal.com.
** edit **
Create a SQL-expression field (Oracle 10 syntax) to extract date string and convert it to a date field:
// {%Allocation Date}
(
-- match date-like string, then convert to date type; is no dates are found, NULL is returned
TO_DATE( REGEXP_SUBSTR( TABLE.FIELD, '\d{1,2}\/\d{1,2}\/\d{2,4}',1 ,1), 'dd/mm/yyyy')
)
While you could
And, as a last resort, you can try converting the multi-line string into a long string by replacing the special characters that represent CR, LF, etc. Replacing them with spaces or another innocuous character, and then treat the resultant string as if it were just a regular string (with the date in the middle).
You would still have to make some assumptions to make this possible: ONE date per string, all special characters are known (or you have to test for all possible special characters), the date has SOME conformity to the format, etc.