objective c - Get 12 noon timestamp of current date in iOS? -


i want timestamp of current date reference 12 noon. can current timestamp

[[nsdate date] timeintervalsince1970]; 

but want timestamp 12 noon today.thanks in advance

i used . give 12 noon timestamp. because it's calculated per [nsdate date] , give on base of device's timezone.

nscalendar *calendar = [[nscalendar alloc] initwithcalendaridentifier:nscalendaridentifiergregorian]; nsdate *today12noon = [calendar datebysettinghour:12 minute:0 second:0 ofdate:[nsdate date] options:0];  double dif = [[nsdate date] timeintervalsince1970] - [today12noon timeintervalsince1970]; double timestampwithreference12noon = [[nsdate date] timeintervalsince1970] - dif ; 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -