我正在尝试使用 Java 读取 CST 时区中的系统日期。我尝试了下面的代码,但是每当我使用formatter.parse()它时,它都会返回 EST 时区的时间。
private Date getTodayInCST() {
Calendar currentdate = Calendar.getInstance();
DateFormat formatter = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
TimeZone obj = TimeZone.getTimeZone("CST");
formatter.setTimeZone(obj);
String today = formatter.format(currentdate.getTime());
try {
return formatter.parse(today);
} catch (ParseException e) {
e.printStackTrace();
}
return null;
}
Run Code Online (Sandbox Code Playgroud) 当我使用Xcode 7.2.1和iPad mini 2进行调试时,Xcode会显示以下消息:
process launch failed: failed to get the task for process 2847
Run Code Online (Sandbox Code Playgroud) 我想使用CNCopySupportedInterfacesAPI来获取Wifi接口的SSID.但我对API有疑问CNCopySupportedInterfaces.此API是否会提供所有已配置Wifi接口的列表,或仅提供当前处于活动状态的接口或有关当时可访问(但未配置)的所有接入点的信息?
我正在为一个教师重构一堆PHP代码.我决定做的第一件事是更新所有要用Drupal SQL编码约定编写的SQL文件,即大写关键字.我写了一些正则表达式:
:%s/create table/CREATE TABLE/gi
:%s/create database/CREATE DATABASE/gi
:%s/primary key/PRIMARY KEY/gi
:%s/auto_increment/AUTO_INCREMENT/gi
:%s/not null/NOT NULL/gi
Run Code Online (Sandbox Code Playgroud)
好的,这是一个开始.现在我只需打开vim中的每个SQL文件,运行所有五个正则表达式,然后保存.这感觉应该是它的五倍.他们可以复制到一个令人讨厌但很容易复制的正则表达式吗?