Check if date is correct in IOS - ios

Currently, I am grabbing the current date by NSDate().timeIntervalSince1970. However, I am concerned that the user will change the date on the phone to mess with my app. So I was wondering which of the two options below is a more suitable fix
Is there some sort of Apple way to grab the current date from an apple server.
Is there a good and reliable API where I can grab current date?

Use the TIMEAPI available at www.timeapi.org
You can retrieve the current time in UTC here.

Related

Extracting universal time/atomic time in flutter

I am working on a demo app in a flutter in which I want universal date time. I am using DateTime.now() but it's giving me devise date and time. Is there any way to get standard/universal date time(America) irrespective of device date-time setup. I want that date-time fetched offline without any connectivity with the internet.
To get universal time use
DateTime.now().toUtc()
to get local time use
someDate.toLocal()
There is no support to getting DateTime for a specific locale other than the one your device is located in (configured).
There is at least one package in pub.dartlang.org that provides such a feature though.
https://pub.dartlang.org/packages/time_machine looks like it does, but I haven't used it myself yet.

I want to change the datepicker for my mobile website on iOS

Currently the datepickers trigger the default iOS datepicker with dd-mm-yyyy format. I would like it to trigger the dddd-dd-mm-yyyy format so users are better at picking the correct date because they can see the actual day of the week.
Is this possible for a mobile website?
I'm not sure about doing it for mobile website. But we can change format of default iOS date picker if you want. It's directly not possible through date picker. There is another component called UIPickerView in iOS, through which we can achieve this. Check how to create UIPickerView for mobile website and place the values you want in pickerView.
So after doing more research on the subject I have found that it is possible to use datetime-local. This triggers the native datepicker with ddd-dd-mm format but also accounts for the year (so scrolling over december 31 will make the date object move to the next year). This workaround has issues with IE though, so is not a universal solution.

Is it possible to do a search for videos updated after date? [YouTube-Data-Api]

I am wondering if it is possible to get a list of videos that have been updated after a specified date? I am writing an application that helps users manage their videos titles, thumbnails, tags, descriptions, etc. This app really targets content creators that put out episodic content on a set schedule but also includes data of past videos. I am currently able to retrieve videos but I don't want to have to retrieve every video at the start of the application. It's both costly as far as the quota is concerned and time consuming. What I would like to do, is retrieve every video when the application starts up for the first time and store the data (done) and then any time after that, retrieve only new videos and/or videos that have been updated since the last date checked. If this is possible please let me know how I would go about this.
If not and a Google engineer happens to see this, this functionality would make for a very useful feature.
Maybe you want to use publishedAfter and publishedBefore from ressource search.list.
The publishedAfter parameter indicates that the API response should
only contain resources created after the specified time. The value is
an RFC 3339 formatted date-time value (1970-01-01T00:00:00Z). (string)
The publishedBefore parameter indicates that the API response should
only contain resources created before the specified time. The value is
an RFC 3339 formatted date-time value (1970-01-01T00:00:00Z). (string)

How do I get list of calendar app data?

For example:
I would like to access all my calendar data (default iOS App) which has user embedded data on
Start date 11/11/2013 10:00 AM with Title "Meeting w/ Australian".
Or another one,
Start date 1/1/2012 08:00 AM with Title "2012 New Year's Party".
How do I access these and put them on NSMutableArray?
Can someone help me here?
Given the quarantine-like protection built in IPhone apps, I bet you won't be able to access the info, I've never tried personally but I'm willing to bet on it.
thats probably why all the calendar apps start empty.
I would look at exporting Ical to CSV then parsing it ingot he app as a hacky way to get around it.
Good luck though.

Twitter API 1.1 search/tweets - search by date

Since the "since" param is no longer in use, how can I search tweets older than specific date ? I understand how to use since_id, but in my case I don't have any historic tweet to take the tweet_id from. How is search by date done these days ?
It's an old question, but since it has no answer i share what i have found regarding this question by reading the docs and using the API.
Since and until params are only for maximum 9 past days.
Instead we can use since_id and max_id. You have to set them to unique ids of tweets. You can find one tweet in the specified time (from any user you want). Detect the id by using the API or simply by Developer tools of your browser.
You can use the until param:
Returns tweets generated before the given date. Date should be
formatted as YYYY-MM-DD. Keep in mind that the search index may not go
back as far as the date you specify here.

Resources