lightning-formatted-date-time - showing previous date (LWC) - web

I am using the tag "lightning-formatted-date-time" in my lightning web components with the value "2019-06-02" but it is displaying the previous date.
I am not getting if the value is not a valid one for the tag. Please suggest.
Here is the playground code.
https://developer.salesforce.com/docs/component-library/tools/playground/nLT72mjyV/1/edit
Thank you.

When i run the same playground code, i get displayed the "Jun 02, 2019" date.
It might be a timezone thing. I would check your OS timezone settings. Also i would try to add the attribute time-zone="UTC" to it, to ensure correct formatting.
Also try to read through the documentation you can find here: https://developer.salesforce.com/docs/component-library/bundle/lightning-formatted-date-time/documentation

This is because of current user time zone. Salesforce save datetime in UTC formate and while returning it give in current user time zone formate.

Related

Allow user to enter millisecond in datetime picker in jsf/adf form

I want to allow user to select millisecond also on datepicker. I have tried differant articles but it allows me to only enter dd-mm-ss and timezone.
please help.
There is only one solution: contact the developers of the component and ask them to add it.

All MODX *publishedon dates showing same date despite different inputs

I am using:
[[*publishedon:strtotime:date=`%e %B %Y`]]
This shows a date (18 August 2015 for some reason) but it won't change. No matter what date I put into the Published On field this will not change.
I have tried reinstalling MODX to no affect.
Would anyone know how to fix this?
It should work that way, if you want to access the publishedon field of the current resource.
If you want to access the publishedon field of resources listed with a getResources template chunk, you have to use
[[+publishedon:strtotime:date=`%e %B %Y`]]
I could be wrong, but have always thought that you can't enter a date into the Published On field; it takes its value from the Publish checkbox. Have you looked at the database to see what date is actually stored for that resource? And if the value stored in the db does in fact change when you enter a new date in the field...?
Ya, you are right:
publishedOn is just the date when the resource was published or published again.
Use a dateTV for something else instead, or better, use publishedOn as a fall back when the dateTV is not set.

XPages Date field with date picker saves value with 12:00:00 time

I use standard dojo date picker and it works fine. Only problem is that actual value that is saved to the document has always 12:00:00 time part. I assume it probably tries to set 12 AM, but since I'm in Europe (CET time zone) it really means noon.
This is quite annoying when I try to do date/time comparison later.
I found posts how I can strip time part completely, e.g. XPages - save date only in Date field , but it needs extra code in post save and in some cases I can't use post save because of access rights.
I understand that XPages work with Java Date that has no option for date only, but at least it should return just 00:00, not 12:00. When I tried to play with timezone setting on the converter I got even different time values in the field.
I was able to change the behavior using custom renderer and component for the datetimehelper, but it is really an overkill. Standard implementation bypasses used convertor, so just custom converter didn't help.
Is there any way how to force the date field to just return date with 00:00 time part? I don't expect any magic where it would save just dateonly field to the document.
Thanks,
M.
No, it's not trying to set 12am and being affected by timezone, what you're seeing is standard. I think it started with 9.0. I suspect the timing is to avoid impacts from Daylight Savings Time changes.
One option is to call .setAnyTime() on the DateTime object for the field.

Workflow to Wait until Date Field

How can a workflow be told to wait until a specific date, or date field?
It works with timeout equals date, but I would much rather use wait until process time is on or after date.
When I try this the workflow is postponed until our distant ancestors have died of old age; it is the same if I put in a date field instead of a specific date (which is the end goal):
You want to consider what is considered a "timeout" for the desired behavior. The following links provide some more context.
Also, unless you have a really specific use case for using a specific date (like year end deadlines or processing) -- you'll probably want to use a datetime field on an entity as the basis for the right side of the comparison. You can always use the dialog on the right to choose a fixed date/time before or after any of the entity datetime fields.
http://social.technet.microsoft.com/wiki/contents/articles/11291.microsoft-dynamics-crm-2011-workflows-wait-and-timeout.aspx
http://www.powerobjects.com/blog/2012/11/06/multiple-waiting-workflows-wait-conditions-and-timeouts/
http://www.dynamicscrmtrickbag.com/2009/07/12/waits-timeouts/
Yes, it will use the current value of the field each time the workflow is checked.
Related: CRM2011 Workflow: What happens if the field which is used in the condition of the workflow is updated after the workflow has started?

J2ME Get current time zone

I have a j2me application and it needs to get the name of the current timezone and send it off to the server.
However, the only format that I seem to be able to get the phone to give me is "GMT-5:00". What I want the application to do is return the timezone's name (EST, PST, etc.)
I iterated over the string[] returned by TimeZone.getAvailableIds() and it has a list of all the time zones in the format that I want them in. (EST, CST, 'Pheonix, USA', 'Europe/Samara', etc.)
Any ideas on how to get the timezone's name instead of as an offset from GMT+0? Thanks in advance.
TimeZone.getID() is what you're looking for; it should return one of the values returned by TimeZone.getAvailableIDs().
you can make an array in which you'll put all your time zone ids. then just add 12 to the returned time zone offset and you can use that as an index for calling time zone names from your array.

Resources