A
A
ang102912018-09-17 19:00:34
C++ / C#
ang10291, 2018-09-17 19:00:34

What date will be displayed if the site is stored in the server, c# language, using the built-in DateTime property?

If the site is stored on the server, what date will be taken from the server or locally (from the PC user)?
Correctly I understand, if it is stored in the server, then the date should be taken from the server? If yes! then what will happen to the time zone, for example, the server time is Moscow, and the client (user) accesses the site from another country or, say, from Siberia? :)
Thanks for the answers!

Answer the question

In order to leave comments, you need to log in

4 answer(s)
M
mefutu, 2018-09-17
@mefutu

After all, you answered your own question... Server time will be taken from DateTime.Now
Ps Of course, it is possible to take time from the client and check it on the server, but you didn't specify why you need it.

E
Evgeny Petrov, 2015-04-10
@Libris

To get data from someone else's server without resorting to CORS , JSONP was invented a long time ago .
However, the whole point of using JSONP is to dynamically create a script with an address that lists not only the parameters, but also the name of the callback function, which will allow it to be run from the eval context .
This means that the server script must be able to form a call to the callback function, to which the generated data is passed. Typically, the name of the callback function parameter . If you don't specify a name for the function itself, jQuery will generate a random name and the function itself as a property of the global object.

$.ajax({
  url: '//api.vk.com/method/database.getCountries',
  data: {
    need_all: 1,
    count: 300
  },
  dataType: 'jsonp'
})
.done(function(data) {
  console.log(data);
});

Sometimes the name of the parameter with the name of the function may differ - this is known in advance.
$.ajax({
  url: 'http://api.flickr.com/services/feeds/photos_public.gne',
  dataType: 'jsonp',
  jsonp: 'jsoncallback',
  data: {
    tags: 'mount rainier',
    tagmode: 'any',
    format: 'json'
  }
}).done(function (data) {
  console.log(data);
});

If the server you are contacting is not able to form a response with a function call on the passed name, then the JSONP option will not work.

T
The Dragger, 2015-04-10
@IPD2

in php you echo "My Ajax request returned" and this text will be returned to you in success.
For Ajax echo it's like for php return , the essence in php return returns and echo displays and in ajax everything that is in echo returns.

B
Billy Milligan, 2015-04-10
@Billy_Milligan

I don't think it's the best answer, but still.
create cross.php

<?php
$num = file_get_contents('https://blockchain.info/tobtc?'.http_build_query($_GET));
echo $num;

Don't forget to change the domain to yours!
(function($){

        $(document).ready(function() {
            $.ajax({
                type: "GET",
                url: "http://localhost/cross.php?currency=USD&value=100",
                dataType    : 'text',
                success: function(html) {
                    alert(html);
                }
            });
        });
    })(jQuery);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question