Control the timezone by posting a tweet with the twitter api and /statuses/update.json

0

I'm using the TwitterAPIExchange.php class to post tweets but when you create them the api sets in the created_at attribute the GMT global time and my intention is to publish it at 09:00 Spanish time.

For example, if I publish a tweet now (22:01 Spanish time), the tweet is published at the moment, but at the time it appears 13:01 - 24 Jan. 2017

Do you know if this attribute can be modified by publishing the tweet or passing the timezone to it?

I tried to change the timezone (the server has timezone 'America / New York') in the php script before publishing the tweet but it does not seem to work.

Any ideas?

I leave the code, but I do not think it helps much either ...

$tweet = "Este es mi tweet"

/** If url exists, send tweet */
if ($retcode === 200) {

  /** API URL to send tweets */ 
  $url = "https://api.twitter.com/1.1/statuses/update.json";
  $requestMethod = 'POST';

  $postFields = array();
  $postFields['status'] = $tweet; 

  $twitter = new TwitterAPIExchange($settings);

  $json =  $twitter->setPostfields($postFields)
    ->buildOauth($url, $requestMethod)
    ->performRequest();

}

link

Well, the problem was in the configuration of the account with which I was doing the authentication that had the wrong time zone.

    
asked by manguiti 24.01.2017 в 21:36
source

0 answers