Proper date format - cocoa

I have used date picker in my iPad App but the output of date is coming as
2011-03-07 06:07:03 +0000
Is there any way to format the time? The above time output is shown when i gave input time as 11:35 AM

Have a look at NSDateFormatter. There's also a date formatting guide.

Related

mac os x change date format temporarily

I use ACDSee 4 for mac and the date format of the exif info = dd-mm-yyyy
This makes perfect sense, because I live in Holland and we use this date notation.
but this is getting a issue when I want to batch rename files using the exif date and time, it's the wrong format if I want to order the filenames.
I can change the regional settings to Canada in my mac system preferences, that works accept I don't want to use AM/PM but 24hr format.
And if I quit ACDSee I need to revert back to the dutch date notation.
My question is:
Is there a bash or apple script that sets the date format to yyyy-mm-dd and 24h time format.
And opens ACDSee.
And when I close ACDSee it reverts back to dd-mm-yyyy ?

How to update date display format in kibana?

I want to change the date display format in kibana. Kibana provides this feature via moment.js, but not enough documentation available, or at least it doesn't work properly.
Current date format: "MMMM Do YYYY, HH:mm:ss.SSS"
Required date format: "DD MMM YY" (like 29 July 17)
I tried changing the date format of the Date field in "Management" section, but that didn't work. (do I need to restart the server or something to make it work)
Or
Where am I going wrong
Or
What are some other ways to change date display format.
and What does popularity of the field do here ?
Some screenshots for the reference.
As a solution, I had to fix it in the scripts feeding data to elasticsearch itself.

Elasticsearch query converting UTC to PST

I am running a date_histogram Elasticsearch query based on a particular time stamp range. I would like to convert the output from UTC to PST. I am running it from now to the previous 7 days ("gte": "now-7d/d"). What do I need to add to convert the output from UTC to PST which is a difference of 8 hours? I researched using the "time_zone" function but I thought that was converting a particular time to UTC ("time_zone": "+01:00").
I don't think there is any easy way (if any) to change the contents of key_as_string field in aggregation result. But, you can very well convert key field which has epoch to PST date in your application.
I hope this is useful.

Unix Shell Script Time Zone BST Or GMT

This is what i'm trying to do:
I want to create a simple shell script that checks the current timezone in the UK.
i.e. BST or GMT.
I only can display the time for the current timezone the UK is in. i.e. UK is in GMT right now and I can only display that time. [TZ=GMT date]
Please note: I do not wish to permanently modify the UNIX time zone on the server (currently CET)
Based on that I need to do some calculations (which I'm fine with)
I have already searched and I cannot find anything specific to this problem. Thank you for your help
To get the date for a particular timezone, you can do:
TZ=GMT date
(Or date +%s if you want epoch format, which is also TZ independent, but altogether friendlier for calculations. ).
For what it is now, relative time I think it's as simple as:
TZ=Europe/London date
Which I think should cause your system to report BST/GMT appropriately.
If you want it to specifically report the offset, you can use the %z format specifier:
TZ=Europe/London date +"%Y%m%d %H:%M:%S %z"

Can TeamCity 6.0.3 Be Set to Show Time in a 12-hour Format?

In TeamCity 6.0.3, is there a way to set the time format to show 12-hour time format instead of 24-hour time format? For example, I would like times to show 2:00 PM instead of 14:00. I found the user-specific setting to show time in the user's timezone but this still displays time in 24-hour format.
I'm afraid, we don't provide such a possibility.

Resources